Migrate packages from 8.13 to 8.14 on Debian

Can't update. Here is the error message

open-output-file: error opening file path: /usr/share/racket/pkgs/.LOCKpkgs.rktd system error: Permission non accordée; errno=13 context...: /usr/share/racket/collects/racket/private/kw-file.rkt:139:2: call-with-output-file* /usr/share/racket/collects/racket/file.rkt:752:0: call-with-file-lock /usr/share/racket/collects/pkg/main.rkt:499:14 body of (submod "/usr/share/racket/collects/pkg/main.rkt" main) /usr/share/racket/collects/raco/raco.rkt:41:0 body of "/usr/share/racket/collects/raco/raco.rkt" body of "/usr/share/racket/collects/raco/main.rkt"

Can you share a bit more about the sequence of events that got you here? Specifically, was this error triggered by running the racket-...-.sh installation file, a later package update step, or something else? If I were a tiny bit cleverer I could figure this out, but perhaps you can help me here.

Oh! based on your message title, it sounds like maybe this was a use of raco pkg migrate, is that right? If so, perhaps the migrate task is trying to update packages that were installed system-wide?

It would help a lot to know what command you ran to get these messages, and at what point it happened!

They may or may not be related, but some times I remember this lock file coming up:

OTOH, I regularly use raco pkg migrate in a setup where the "installation" scope, equivalent to /usr/share/racket/*, is installed via Guix on a read-only filesystem.

Last I checked, raco pkg migrate only handles user-scope packages.

As a user :

raco pkg migrate 8.13

or from drracket (as a user) -> package -> install package some package.

I don't remember having any problem when upgrading to 8.13.

raco pkg config gives

name:
  8.14
catalogs:
  https://download.racket-lang.org/releases/8.14/catalog/
  https://pkgs.racket-lang.org
  https://planet-compats.racket-lang.org
default-scope:
  user
   Note: `default-scope` in installation scope is not effective,
   because `default-scope` is configured in a narrower scope
download-cache-dir:
  /home/cyrille/.racket/download-cache
download-cache-max-files:
  1024
download-cache-max-bytes:
  268435456
git-checkout-credentials:
trash-max-packages:
  512
trash-max-seconds:
  172800
network-retries:
  5

Seems to be solved with :slight_smile:

raco pkg migrate -u 8.13

The packages are installed but :

  • I have many errors due to
raco setup:     path: /usr/share/racket/pkgs/htdp-lib/test-engine/test-info.scm
raco setup:     system error: no such file or directory; rkt_err=3
  • when I launch drracket with say #lang fsm, I've got the following message :
../../usr/share/racket/collects/racket/file.rkt:757:8: open-output-file: error opening file
  path: /usr/share/racket/pkgs/.LOCKpkgs.rktd
  system error: Permission non accordée; errno=13

Interactions disabled.

:angry:

To answer jbclements, the upgrade was made via apt without any error.

The packages to be upgraded were not installed system-wide : they are not present in /usr/share/racket/pkgs/.

From a fresh re-install, the pkgs moved from ~/.racket/8.14/pkgs to ~/.local/share/racket/8.14/pkgs if that helps.

Did you re-install using APT, or some other way?

I'll ping @bremner (who maintains the Debian packages) just in case he has any thoughts, but I would consider this a Racket bug.

It looks like the Debian package racket-common vestion 8.14+dfsg1-1 installs /usr/share/racket/pkgs/.LOCKpkgs.rktd. I just checked, and the equivalent file also exists in the Guix packaging, with which I use raco pkg migrate regularly. If the permissions are different than what I see:

philip@bastet:~$ ls -l /gnu/store/09x10nv8y78lmdjpdw37gphg926bwvdx-racket-8.13/lib/racket/pkgs/.LOCKpkgs.rktd 
-r--r--r-- 1 root root 0 Dec 31  1969 /gnu/store/09x10nv8y78lmdjpdw37gphg926bwvdx-racket-8.13/lib/racket/pkgs/.LOCKpkgs.rktd

that might be one way to end up with a problem.

The message in @mflatt's keep ".LOCKpkgs.rktd" for source install · racket/racket@39fda5e · GitHub says that it Closes PR 15062, but I can't find what issue or PR that might have been referring to.

1 Like

I removed all racket package with aptitude, deleted my ~/.racket where the 8.13 and 8.14 pkgs were and re-installed racket-8.14+dfsg1-1 using aptitude (I'm on testing).
I then was able to install my packages the usual way within drracket.
The packages installed went in ~/.local/share/racket/8.14/pkgs, not in ~/.racket

Finally,

$ ls-l /usr/share/racket/pkgs/.LOCKpkgs.rktd 
-rw-r--r-- 1 root root 0 2024-08-29 16:37:09 /usr/share/racket/pkgs/.LOCKpkgs.rktd

Apologies if I'm missing something here, but I do believe that we changed from using ~/.racket to using ~/.local/share/racket some time ago; I wonder whether your problem is related to this? I can certainly imagine some more-recent piece of code assuming that the current user-local directory is the only place it needs to look. For instance, if raco pkg migrate saw that you had package foo installed but then couldn't find it in ~/.local/share/racket and then decided it must ... be installed in the global location. This is pure guesswork on my part, almost certainly wrong in some details?

My installation is two or thrree years old so maybe at the time pkgs were in ~/.racket. Nonetheless everything is ok now.
Waiting for the next version !
Thx