Skip to content
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

Failure to open cache hash makes task to exit with non 0 exit code (to fail) #6974

Closed
labeled opened this issue Sep 9, 2021 · 4 comments
Closed
Labels
blocked: retry with latest Retry with latest release or head. outdated scope: core core nx functionality type: bug

Comments

@labeled
Copy link

labeled commented Sep 9, 2021

Current Behavior

Unknown to me I sometimes get a operation not permitted to open the cache hash. We use a different cacheDirectory by using a custom tasksRunnerOptions to put the cache's in a separate folder that is shared between builds. This could be similar to #6957 in that you could use a try catch to not return a non 0 exit code.

Expected Behavior

We had not seen this before migrating to Azure DevOps but we don't think that is the root cause of the issue.

Steps to Reproduce

Failure Logs

Unexpected error:
Error: EPERM: operation not permitted, open 'C:\PIT\latestOutputsHashes\coverage\apps\chassis-tracker.hash'
at Object.openSync (fs.js:498:3)
at Object.writeFileSync (fs.js:1524:35)
at Object.writeToFile (C:\azagent_work\1\s\altec.voyager.web-ui\node_modules@nrwl\workspace\src\utilities\fileutils.js:13:10)
at C:\azagent_work\1\s\altec.voyager.web-ui\node_modules@nrwl\workspace\src\tasks-runner\cache.js:119:25
at Array.forEach ()
at Cache.recordOutputsHash (C:\azagent_work\1\s\altec.voyager.web-ui\node_modules@nrwl\workspace\src\tasks-runner\cache.js:117:17)
at TaskOrchestrator. (C:\azagent_work\1\s\altec.voyager.web-ui\node_modules@nrwl\workspace\src\tasks-runner\task-orchestrator.js:270:28)
at Generator.next ()
at fulfilled (C:\azagent_work\1\s\altec.voyager.web-ui\node_modules\tslib\tslib.js:114:62)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
errno: -4048,
syscall: 'open',
code: 'EPERM',
path: 'C:\PIT\latestOutputsHashes\coverage\apps\chassis-tracker.hash'

Environment

Node : 16.6.1
OS : win32 x64
npm : 7.20.1

nx : Not Found
@nrwl/angular : 12.6.2
@nrwl/cli : 12.6.2
@nrwl/cypress : 12.6.2
@nrwl/devkit : 12.6.2
@nrwl/eslint-plugin-nx : 12.6.2
@nrwl/express : Not Found
@nrwl/jest : 12.6.2
@nrwl/linter : 12.6.2
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 12.6.2
@nrwl/web : Not Found
@nrwl/workspace : 12.6.2
@nrwl/storybook : 12.6.2
@nrwl/gatsby : Not Found
typescript : 4.3.5

@minijus
Copy link
Contributor

minijus commented Sep 10, 2021

I believe it is duplicate of #6957 - stacktraces look identical. The should be mitigated with #6959.

First I thought that it is our volume issue that we use on CI, but it strangely coincided with nx update to 12.9. We have never seen such errors before 12.9.

@FrozenPandaz FrozenPandaz added blocked: retry with latest Retry with latest release or head. scope: core core nx functionality labels Sep 10, 2021
@FrozenPandaz
Copy link
Collaborator

Hm this seems like a separate issue to me. In this case, the error is not expected. It seems as if the directory does not exist.

Is C:\PIT\ the directory that you expect your cache to be written to? Could you also check if node_modules/.cache/nx has any files written to it when executing this command?

Also, please try with the latest version of Nx. Some recent changes have updated where cache files are written so this may be fixed already.

@labeled
Copy link
Author

labeled commented Sep 11, 2021

Yes that's correct. I found that it was due to a new service account that was added to ADO. Giving it more permission to that folder resolved the issue.

@labeled labeled closed this as completed Sep 11, 2021
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: retry with latest Retry with latest release or head. outdated scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

3 participants