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

Unhandled exceptions when trying to write files on a read-only directory #154

Open
lcampos opened this issue Mar 10, 2021 · 0 comments
Open

Comments

@lcampos
Copy link
Contributor

lcampos commented Mar 10, 2021

Summary

The test:run command fails with and unhandled exceptions when a user tries to write the execution results on a folder they don't have access to or is a read-only folder.

Steps To Reproduce:

  1. Run force:test:run and provide an output directory that is set as a read only directory
  2. sfdx force:apex:test:run -l RunLocalTests -d "/.sfdx/tools/customresultsv2"
sfdx force:apex:test:run -l RunLocalTests -d "/.sfdx/tools/customresultsv2"             
Listening for streaming state changes...
Processing test run 7075A0000BiWoduQQC
Processing test run 7075A0000BiWoduQQC
Processing test run 7075A0000BiWoduQQC
Processing test run 7075A0000BiWoduQQC
Processing test run 7075A0000BiWoduQQC
Processing test run 7075A0000BiWoduQQC
Run "sfdx force:apex:test:report -i 7075A0000BiWodu -u [email protected]" to retrieve test results
(node:85517) UnhandledPromiseRejectionWarning: Error: EROFS: read-only file system, mkdir '/.sfdx'
    at Object.mkdirSync (fs.js:987:3)
    at ensureDirectoryExists (/Users/lcamposguajardo/github/DevTools/salesforcedx-apex/packages/plugin-apex/node_modules/@salesforce/apex-node/src/utils/fileSystemHandler.ts:17:6)
    at ensureDirectoryExists (/Users/lcamposguajardo/github/DevTools/salesforcedx-apex/packages/plugin-apex/node_modules/@salesforce/apex-node/src/utils/fileSystemHandler.ts:16:3)
    at ensureDirectoryExists (/Users/lcamposguajardo/github/DevTools/salesforcedx-apex/packages/plugin-apex/node_modules/@salesforce/apex-node/src/utils/fileSystemHandler.ts:16:3)
    at ensureFileExists (/Users/lcamposguajardo/github/DevTools/salesforcedx-apex/packages/plugin-apex/node_modules/@salesforce/apex-node/src/utils/fileSystemHandler.ts:21:3)
    at /Users/lcamposguajardo/github/DevTools/salesforcedx-apex/packages/plugin-apex/node_modules/@salesforce/apex-node/src/utils/fileSystemHandler.ts:57:5
    at Array.map (<anonymous>)
    at Object.<anonymous> (/Users/lcamposguajardo/github/DevTools/salesforcedx-apex/packages/plugin-apex/node_modules/@salesforce/apex-node/src/utils/fileSystemHandler.ts:56:33)
    at Generator.next (<anonymous>)
    at /Users/lcamposguajardo/github/DevTools/salesforcedx-apex/packages/plugin-apex/node_modules/@salesforce/apex-node/lib/src/utils/fileSystemHandler.js:14:71
(Use `node --trace-warnings ...` to show where the warning was created)
(node:85517) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:85517) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected result

The command should finish the execution successfully and provide a warning that files couldn't be created since the path provided is not writeable.

@xyc xyc assigned xyc and unassigned xyc May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants