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

Silent errors with faulty environment file #93

Closed
jaimergp opened this issue Nov 14, 2020 · 5 comments · Fixed by #94
Closed

Silent errors with faulty environment file #93

jaimergp opened this issue Nov 14, 2020 · 5 comments · Fixed by #94
Milestone

Comments

@jaimergp
Copy link
Member

If a user provides an invalid YAML file (e.g. wrong section name), the action fails to update the environment with that file, but doesn't report the failure.

To reproduce, try using a YAML file like this:

name: test
channels:
  - conda-forge
  - defaults
requirements:
  - compilers
  - python

Note how I used requirements instead of dependencies. You will see this unreported error:

# Updating conda environment from yaml file...
##############################################

/usr/share/miniconda/condabin/conda env update --file devtools/conda-envs/test_env.yaml --name test

EnvironmentSectionNotValid: The following section on '/home/runner/work/yank/yank/devtools/conda-envs/test_env.yaml' is invalid and will be ignored:
 - requirements

#
# To activate this environment, use
#
#     $ conda activate test
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Example on a real log.

@goanpeca
Copy link
Member

Hi @jaimergp thanks for the report!

Could you try to debug this by adding some console.loghere with https://github.com/conda-incubator/setup-miniconda/blob/master/src/setup.ts#L113 ?

It might be that conda env is not actually raising the right exit codes and we might need to add some extra logic to check for the output text.

@jaimergp
Copy link
Member Author

Yes, you are right, conda env does not return 1 because that invalid section is simply ignored. I guess we'll have to inspect stdout for EnvironmentSectionNotValid.

@goanpeca
Copy link
Member

I guess we'll have to inspect stdout for EnvironmentSectionNotValid.

Yes, exactly. Thanks for confirming this :)

Wanna take a stab at it?

@jaimergp
Copy link
Member Author

jaimergp commented Nov 16, 2020

I am not familiar with JS/TS at all, but I'll try! The string should be available here, right?

edit: nvm, I think I got it.

@goanpeca
Copy link
Member

You may need to add listener for the stdout (if those errors are not printed to sterr, but to stdout)

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

Successfully merging a pull request may close this issue.

2 participants