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

Opam configuration corrupted on ENOSPC #4157

Closed
g2p opened this issue Apr 24, 2020 · 1 comment
Closed

Opam configuration corrupted on ENOSPC #4157

g2p opened this issue Apr 24, 2020 · 1 comment

Comments

@g2p
Copy link

g2p commented Apr 24, 2020

If opam update --upgrade encounters errors due to lack of free space, the next opam upgrade will attempt to remove all packages.

Looking at the --debug output, this is because ~/.opam/repo/repos-config got corrupted and replaced by an empty file; all packages are considered orphaned after this.

This debug message should probably be upgraded to a user-visible warning (or error, if actively used):

00:00.251  STATE                  Ignoring globally-selected repository "default", no configured repository by this name found

Quick fix for anyone hitting this:

opam repository add default --set-default https://opam.ocaml.org
# opam config report
# opam-version      2.0.7 
# self-upgrade      no
# system            arch=x86_64 os=linux os-distribution=ubuntu os-version=20.04
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              7
# repositories      
# pinned            0
# current-switch    4.10.0+fp+flambda
@rjbou
Copy link
Collaborator

rjbou commented Apr 27, 2020

Thanks for the report. Opam tries to keep a consistent state when a command or an action fail, but when there is no more space, it's hard to write to good configuration.
I'll close this issue, as duplicated of #2715, we can continue the discussion there.

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