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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENOENT: no such file or directory, stat '/var/folders/.../T/automation-logs-up-.../eventlog.txt' #9065

Closed
jitbasemartin opened this issue Feb 28, 2022 · 1 comment 路 Fixed by #9097
Labels
area/automation-api kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@jitbasemartin
Copy link
Contributor

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

Uncaught exception with nodejs runtime and Pulumi Automation API v3.25.0 (NodeJS 16.13.0)

Uncaught exception: 'Error: ENOENT: no such file or directory, stat '/var/folders/68/g0qw_p0s6lg94ymccg0438h00000gp/T/automation-logs-up-AfbzNQ/eventlog.txt'

Steps to reproduce

  1. Use a project with automation API and external program
  2. Create a valid program
  3. If an error occurs with a resource, the project exit with an uncaught exception

Investigation

After investigating the issue, I saw the problem is in the following line:

[upResult, logResult] = await Promise.all([upPromise, logPromise]);

upPromise thrown an error, then logResult is not defined. In the finally the tail log is not cleaned but the log file is deleted

@jitbasemartin jitbasemartin added the kind/bug Some behavior is incorrect or out of spec label Feb 28, 2022
@jitbasemartin jitbasemartin changed the title Uncaught exception: Error: ENOENT: no such file or directory, stat '/var/folders/68/g0qw_p0s6lg94ymccg0438h00000gp/T/automation-logs-up-AfbzNQ/eventlog.txt ENOENT: no such file or directory, stat '/var/folders/.../T/automation-logs-up-.../eventlog.txt' Feb 28, 2022
@jitbasemartin
Copy link
Contributor Author

Fix suggestion

let upResult;
let logResult;
try {
    [upResult, logResult] = yield Promise.all([upPromise, logPromise]);
}
catch (e) {
    didError = true;
    if(!logResult) logResult = yield logPromise
    throw e;
}
finally {
    onExit(didError);
    yield cleanUp(logFile, logResult);
}

Frassle pushed a commit that referenced this issue Mar 11, 2022
* Get log result even if error occurs

* Update changelog

* Simplify await upPromise block
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Mar 11, 2022
Frassle added a commit that referenced this issue Mar 23, 2022
Same fix as in #9097 but for the preview command.
Frassle added a commit that referenced this issue Mar 23, 2022
* Fix #9065 for previews

Same fix as in #9097 but for the preview command.

* Add to CHANGELOG
@mikhailshilkov mikhailshilkov added this to the 0.70 milestone Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/automation-api kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants