-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add exception message to 'failed to create output directory' #17951
Closed
EdSchouten
wants to merge
1
commit into
bazelbuild:master
from
EdSchouten:eschouten/20230402-error-message
Closed
Add exception message to 'failed to create output directory' #17951
EdSchouten
wants to merge
1
commit into
bazelbuild:master
from
EdSchouten:eschouten/20230402-error-message
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
awaiting-review
PR is awaiting review from an assigned reviewer
label
Apr 2, 2023
sgowroji
added
team-Local-Exec
Issues and PRs for the Execution (Local) team
team-Remote-Exec
Issues and PRs for the Execution (Remote) team
and removed
team-Local-Exec
Issues and PRs for the Execution (Local) team
labels
Apr 3, 2023
EdSchouten
force-pushed
the
eschouten/20230402-error-message
branch
from
April 3, 2023 17:14
34d80b8
to
cdb04dc
Compare
It looks like all of the similar code paths in this file properly attach the exception message to the error message, while this one does not. Omitting the message makes it hard to figure out the root cause. While there, make a minor error message string formatting improvement.
EdSchouten
force-pushed
the
eschouten/20230402-error-message
branch
from
April 4, 2023 07:13
cdb04dc
to
67c6ec6
Compare
EdSchouten
added a commit
to EdSchouten/bazel
that referenced
this pull request
Apr 4, 2023
I would receive reports of build failures along these lines: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo' In order to root cause this, I made a minor change to Bazel to extend its logging. See bazelbuild#17951. With that change applied, the error became: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo': .../some/path/foo (Not a directory) I was eventually able to reproduce this by manually creating an output file at bazel-bin/some/path/foo, followed by attempting to build the target. It looks like Bazel simply attempts to create output directories without taking into consideration whether a file already exists at the target location. This is problematic when someone alters an existing build target to emit a directory instead of a regular file. bb_clientd reports itself as being an ActionFileSystemType.REMOTE_FILE_SYSTEM. Based on the documentation for this enum value, I think this is correct. bb_clientd is capable of persisting information on previous builds and reloading it. This means that if a previous build yielded a regular file, a successive build would need to explicitly remove it before replacing it with an output directory. reateActionFsOutputDirectories() assumes that it doesn't need to do any cleanups. I therefore think it's only safe to use in case of ActionFileSystemType.IN_MEMORY_ONLY_FILE_SYSTEM. We should therefore only call it if !ActionFileSystemType.supportsLocalActions().
coeuvre
approved these changes
Apr 4, 2023
EdSchouten
added a commit
to EdSchouten/bazel
that referenced
this pull request
Apr 4, 2023
I would receive reports of build failures along these lines: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo' In order to root cause this, I made a minor change to Bazel to extend its logging. See bazelbuild#17951. With that change applied, the error became: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo': .../some/path/foo (Not a directory) I was eventually able to reproduce this by manually creating an output file at bazel-bin/some/path, followed by attempting to build the target. It looks like Bazel simply attempts to create output directories without taking into consideration whether a file already exists at the target location. This is problematic when someone alters an existing build target to emit a directory instead of a regular file. Note that this only an issue when the remote action file system is used. Plain builds (ones that don't use Builds without the Bytes or bb_clientd) are unaffected. This change addresses this issue by reusing the same fallback path creation strategy that plain builds already use.
@bazel-io flag |
bazel-io
added
the
potential release blocker
Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone
label
Apr 4, 2023
justinhorvitz
approved these changes
Apr 4, 2023
@bazel-io fork 6.2.0 |
bazel-io
removed
the
potential release blocker
Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone
label
Apr 4, 2023
Hi @justinhorvitz, Since I can see that this PR has been approved, please let me know whether I should proceed with importing it.Thanks! |
@sgowroji yes you may proceed with importing thank you |
sgowroji
added
awaiting-PR-merge
PR has been approved by a reviewer and is ready to be merge internally
and removed
awaiting-review
PR is awaiting review from an assigned reviewer
labels
Apr 5, 2023
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 11, 2023
I would receive reports of build failures along these lines: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo' In order to root cause this, I made a minor change to Bazel to extend its logging. See #17951. With that change applied, the error became: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo': .../some/path/foo (Not a directory) I was eventually able to reproduce this by manually creating an output file at bazel-bin/some/path, followed by attempting to build the target. It looks like Bazel simply attempts to create output directories without taking into consideration whether a file already exists at the target location. This is problematic when someone alters an existing build target to emit a directory instead of a regular file. Note that this only an issue when the remote action file system is used. Plain builds (ones that don't use Builds without the Bytes or bb_clientd) are unaffected. This change addresses this issue by reusing the same fallback path creation strategy that plain builds already use. Closes #17968. PiperOrigin-RevId: 523408378 Change-Id: I0d7559352687c317de72e0bf5bc6b5ba7452f97e
ShreeM01
removed
the
awaiting-PR-merge
PR has been approved by a reviewer and is ready to be merge internally
label
Apr 11, 2023
ShreeM01
pushed a commit
to ShreeM01/bazel
that referenced
this pull request
Apr 12, 2023
I would receive reports of build failures along these lines: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo' In order to root cause this, I made a minor change to Bazel to extend its logging. See bazelbuild#17951. With that change applied, the error became: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo': .../some/path/foo (Not a directory) I was eventually able to reproduce this by manually creating an output file at bazel-bin/some/path, followed by attempting to build the target. It looks like Bazel simply attempts to create output directories without taking into consideration whether a file already exists at the target location. This is problematic when someone alters an existing build target to emit a directory instead of a regular file. Note that this only an issue when the remote action file system is used. Plain builds (ones that don't use Builds without the Bytes or bb_clientd) are unaffected. This change addresses this issue by reusing the same fallback path creation strategy that plain builds already use. Closes bazelbuild#17968. PiperOrigin-RevId: 523408378 Change-Id: I0d7559352687c317de72e0bf5bc6b5ba7452f97e
ShreeM01
pushed a commit
to ShreeM01/bazel
that referenced
this pull request
Apr 12, 2023
It looks like all of the similar code paths in this file properly attach the exception message to the error message, while this one does not. Omitting the message makes it hard to figure out the root cause. While there, make a minor error message string formatting improvement. Closes bazelbuild#17951. PiperOrigin-RevId: 523461253 Change-Id: I96e434d0934c26ecc696cf386362ee17a6588cc5
ShreeM01
added a commit
that referenced
this pull request
Apr 13, 2023
It looks like all of the similar code paths in this file properly attach the exception message to the error message, while this one does not. Omitting the message makes it hard to figure out the root cause. While there, make a minor error message string formatting improvement. Closes #17951. PiperOrigin-RevId: 523461253 Change-Id: I96e434d0934c26ecc696cf386362ee17a6588cc5 Co-authored-by: Ed Schouten <[email protected]>
ShreeM01
added a commit
that referenced
this pull request
Apr 13, 2023
I would receive reports of build failures along these lines: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo' In order to root cause this, I made a minor change to Bazel to extend its logging. See #17951. With that change applied, the error became: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo': .../some/path/foo (Not a directory) I was eventually able to reproduce this by manually creating an output file at bazel-bin/some/path, followed by attempting to build the target. It looks like Bazel simply attempts to create output directories without taking into consideration whether a file already exists at the target location. This is problematic when someone alters an existing build target to emit a directory instead of a regular file. Note that this only an issue when the remote action file system is used. Plain builds (ones that don't use Builds without the Bytes or bb_clientd) are unaffected. This change addresses this issue by reusing the same fallback path creation strategy that plain builds already use. Closes #17968. PiperOrigin-RevId: 523408378 Change-Id: I0d7559352687c317de72e0bf5bc6b5ba7452f97e Co-authored-by: Ed Schouten <[email protected]>
fweikert
pushed a commit
to fweikert/bazel
that referenced
this pull request
May 25, 2023
I would receive reports of build failures along these lines: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo' In order to root cause this, I made a minor change to Bazel to extend its logging. See bazelbuild#17951. With that change applied, the error became: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo': .../some/path/foo (Not a directory) I was eventually able to reproduce this by manually creating an output file at bazel-bin/some/path, followed by attempting to build the target. It looks like Bazel simply attempts to create output directories without taking into consideration whether a file already exists at the target location. This is problematic when someone alters an existing build target to emit a directory instead of a regular file. Note that this only an issue when the remote action file system is used. Plain builds (ones that don't use Builds without the Bytes or bb_clientd) are unaffected. This change addresses this issue by reusing the same fallback path creation strategy that plain builds already use. Closes bazelbuild#17968. PiperOrigin-RevId: 523408378 Change-Id: I0d7559352687c317de72e0bf5bc6b5ba7452f97e
fweikert
pushed a commit
to fweikert/bazel
that referenced
this pull request
May 25, 2023
It looks like all of the similar code paths in this file properly attach the exception message to the error message, while this one does not. Omitting the message makes it hard to figure out the root cause. While there, make a minor error message string formatting improvement. Closes bazelbuild#17951. PiperOrigin-RevId: 523461253 Change-Id: I96e434d0934c26ecc696cf386362ee17a6588cc5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It looks like all of the similar code paths in this file properly attach the exception message to the error message, while this one does not. Omitting the message makes it hard to figure out the root cause.
While there, make a minor error message string formatting improvement.