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

Hook install failed - Cannot uninstall 'PyYAML' #595

Open
3 tasks done
licsuj27 opened this issue Jan 28, 2021 · 1 comment
Open
3 tasks done

Hook install failed - Cannot uninstall 'PyYAML' #595

licsuj27 opened this issue Jan 28, 2021 · 1 comment

Comments

@licsuj27
Copy link

licsuj27 commented Jan 28, 2021

Due to changes in the charm command, if this is an issue with one of the following, please report it against https://github.com/juju/charmstore-client/issues

  • charm grant or charm revoke
  • charm list or charm list-resources
  • charm login or charm logout
  • charm publish
  • charm pull
  • charm push
  • charm set
  • charm show
  • charm terms
  • charm whoami

Otherwise, if you have a feature request or issue with any other charm command please delete the above and continue below

Checklist

  • Confirmed this is an issue with charm-tools, not charmstore-client
  • Provide versions of tools used
  • Described the feature or ways to replicate the issue

What version am I running?

I ran the following command: snap info charm and got the following ouput:

2.8.1

I am using: (Your operating system)
ubuntu 18:04

Issue/Feature

When deploying the vanilla example project, I am getting error - hook failed- ' install'

I expect/expected the following

Container installing apache applications

Tell us what you think should have happened, including commands, outputs, etc
I am still new to juju charms, hence not sure what is the issue.

What I got

juju debug-log
ERROR juju.worker.uniter.operation hook "install" (via explicit, bespoke hook script) failed: exit st atus 1

Give us what you got, commands run, output, etc. If this is a feature request, delete this section.

juju debug-hooks vanilla/0

Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to i t which would lead to only a partial uninstall.

@licsuj27
Copy link
Author

Ok,

So I changed line 207 in ~/charms/builds/vanilla/lib/charms/layer/basic.py and amendned

if not cfg.get('use_venv', True) and pre_eoan:
reinstall_flag = '--ignore-installed'
check_call([pip, 'install', '-U', reinstall_flag, '--no-index',
'--no-cache-dir', '-f', 'wheelhouse'] + list(pkgs),
env=_get_subprocess_env())

to

if not cfg.get('use_venv', True) and pre_eoan:
reinstall_flag = '--ignore-installed'
check_call([pip, 'install', '-U', reinstall_flag, '--no-index',
'--no-cache-dir', '--ignore-installed', '-f', 'wheelhouse'] + list(pkgs),
env=_get_subprocess_env())

             Is this normal practice?

@licsuj27 licsuj27 reopened this Jan 28, 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

1 participant