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

Crash: Garden crashes on I/O errors while artifacts copying #6261

Closed
Kalithasan-Periyasamy opened this issue Jul 8, 2024 · 1 comment · Fixed by #6319
Closed

Crash: Garden crashes on I/O errors while artifacts copying #6261

Kalithasan-Periyasamy opened this issue Jul 8, 2024 · 1 comment · Fixed by #6319
Assignees

Comments

@Kalithasan-Periyasamy
Copy link

Kalithasan-Periyasamy commented Jul 8, 2024

Crash report

When garden test is run and the test command fails, Garden 0.13 crashes instead of exiting with a runtime error.
So, the error output looks too verbose and confusing. See the details below.

Error message

Garden 0.13

Encountered an unexpected Garden error. This is likely a bug 🍂

You can help by reporting this on GitHub: https://github.com/garden-io/garden/issues/new?labels=bug,crash&template=CRASH.md&title=Crash%3A%20Cannot%20copy%20%60.%2Fsrc-dir%60%3A%20the%20file%20doesn%27t%20exist

Please attach the following information to the bug report after making sure that the error message does not contain sensitive information:

Failed processing Test type=exec name=test (from module test-module) (took 3.04 sec). This is what happened:
CpyError: Cannot copy `./src-dir`: the file doesn't exist
    at file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/index-_bbuTLSX.mjs:5874:11
    at cpy (file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/index-_bbuTLSX.mjs:5954:4)
    at file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/common-Co5xZozR.mjs:67:15
    at async Promise.all (index 0)
    at async Object.<anonymous> (file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/test-BNy_r1mw.mjs:27:5)
    at async Object.assign.handlerType.handlerType (file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/garden.mjs:795076:28)
    at async Router.callHandler (file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/garden.mjs:795047:24)
    at async run (file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/garden.mjs:796054:28)
    at async TestTask.process (file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/garden.mjs:375478:28)
    at async descriptor.value (file:///~/io.garden.garden/1721670966-BlpFWH3.r/rollup/garden.mjs:370894:29)

Garden 0.12

In Garden 0.12 it looks much better and concise:

Failed running test tests in module test-module. Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Cannot copy `src-dir`: the file doesn't exist
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1 test action(s) failed!

What did you do?

Run garden test with the following config:

  • garden.yml
Click here to expand `garden.yml`
apiVersion: garden.io/v0
kind: Project
name: repro-6261

environments:
  - name: local

providers:
  - name: exec
    environments: [local]

---
kind: Module
type: exec
name: test-module
local: true
tests:
  - name: test
    command: [./test-cmd.sh]
    artifacts:
      - source: src-dir
        target: dst-dir
  • test-cmd.sh - a simple sh script that prints some outputs and fails
Click here to expand `test-cmd.sh`
echo "Executing..."
exit 1

Your environment

  • OS:
  • How I'm running Kubernetes:
  • **Garden version: 0.13.32

Frequency

Permanently.

Workaround

None.

Additional context

The same issue happens when garden run test command is used.

Comments:

  • The output in 0.13 is confusing because this is not a bug in Garden
  • The output in 0.12 is much cleaner
  • In practice, the test failed and artifacts couldn't be copied, but without the output of the tests, the current output is confusing
  • In 0.12, it was possible to add --logger-type=basic in the CI and see the output of the test command, but in 0.13 this is not possible (even if it's supposed to be a default option now - see docs)
@vvagaytsev
Copy link
Collaborator

Thanks for reporting the crash-error, @Kalithasan-Periyasamy!

Could you please provide more details and a reproducible example? See the other crash reports as examples.

@vvagaytsev vvagaytsev changed the title Crash: Cannot copy ./test-reports: the file doesn't exist Crash: Garden crashes on I/O errors while artifacts copying Jul 25, 2024
@vvagaytsev vvagaytsev self-assigned this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants