doctorfree / MusicPlayerPlus

Featureful ncurses based MPD client inspired by ncmpc with integration for Beets, spectrum visualization,Bandcamp/Soundcloud, asciimatics, cantata, and more
https://musicplayerplus.dev
MIT License
77 stars 1 forks source link

Permission error on pamac update musicplayerplus-v2.0.1r3-2 #12

Closed JOJ0 closed 1 year ago

JOJ0 commented 1 year ago

Hi! sorry for being brief and unspecific. I just updated my Manjaro and got this compile error. I'm not sure if it's rather my own fault, than having anything to do with the arch package from AUR. I'm not even sure if that's provided by you or someone else. So sorry again! Just wanted to quickly report, I might find time later to move on with investigations. I saved the rest of the log in a textfile locally, this is just the end of what pamac threw on a system upgrade. HTH and speak soon, all the best

[93/93] Linking build/src/bindings/_gaia2.cpython-310-x86_64-linux-gnu.so
Waf: Leaving directory `/var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia/build'
'build' finished successfully (2m46.441s)
Waf: Entering directory `/var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia/build'
- building from /var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia
+ install /usr/lib/libgaia2.a (from build/src/libgaia2.a)
Waf: Leaving directory `/var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia/build'
Build failed
Traceback (most recent call last):
  File "/var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia/.waf3-2.0.19-24ce92eca163982cad0dc09f2a63caad/waflib/Build.py", line 596, in do_install
    self.copy_fun(src,tgt)
  File "/var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia/.waf3-2.0.19-24ce92eca163982cad0dc09f2a63caad/waflib/Build.py", line 539, in copy_fun
    shutil.copy2(src,tgt)
  File "/usr/lib/python3.10/shutil.py", line 434, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.10/shutil.py", line 256, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/usr/lib/libgaia2.a'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia/.waf3-2.0.19-24ce92eca163982cad0dc09f2a63caad/waflib/Task.py", line 180, in process
    ret=self.run()
  File "/var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia/.waf3-2.0.19-24ce92eca163982cad0dc09f2a63caad/waflib/Build.py", line 562, in run
    fun(x.abspath(),y.abspath(),x.path_from(launch_node))
  File "/var/tmp/pamac-build-jojo/musicplayerplus/src/musicplayerplus/gaia/.waf3-2.0.19-24ce92eca163982cad0dc09f2a63caad/waflib/Build.py", line 602, in do_install
    raise Errors.WafError('Could not install the file %r'%tgt,e)
waflib.Errors.WafError: Could not install the file '/usr/lib/libgaia2.a'

==> ERROR: A failure occurred in prepare().
    Aborting...

Above's error was while using pamac graphical interface.

I tried again on text console,

but that threw a different error:

   ~  sudo pamac upgrade
Warning: Building packages as dynamic user
Warning: Setting build directory to /var/cache/pamac
Preparing...
Synchronizing package databases...
Refreshing AUR...                                                                                                                                                                            
Checking musicplayerplus dependencies...                                                                                                                                                     
Resolving dependencies...
Checking inter-conflicts...

To build (1):
  musicplayerplus  v2.0.1r3-2  (v2.0.1r3-1)  AUR

Edit build files : [e] 
Apply transaction ? [e/y/N] y

Cloning musicplayerplus build files...
Running as unit: run-u495.service
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 513ms
CPU time consumed: 122ms
Generating musicplayerplus information...
Running as unit: run-u496.service
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 1.411s
CPU time consumed: 1.587s

Building musicplayerplus...
Running as unit: run-u497.service
Press ^] three times within 1s to disconnect TTY.
==> Making package: musicplayerplus v2.0.1r3-2 (Mo 19 Dez 2022 11:54:48)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning musicplayerplus git repo...
Cloning into bare repository '/var/cache/private/pamac/musicplayerplus/musicplayerplus'...
remote: Enumerating objects: 24498, done.
remote: Counting objects: 100% (565/565), done.
remote: Compressing objects: 100% (286/286), done.
remote: Total 24498 (delta 304), reused 511 (delta 274), pack-reused 23933
Receiving objects: 100% (24498/24498), 172.48 MiB | 17.11 MiB/s, done.
Resolving deltas: 100% (16941/16941), done.
==> Validating source files with sha256sums...
    musicplayerplus ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of musicplayerplus git repo...
Cloning into 'musicplayerplus'...
done.
Updating files: 100% (2235/2235), done.
Switched to a new branch 'makepkg'
==> Starting prepare()...
Cloning into 'bliss-analyze'...
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 29 (delta 12), reused 19 (delta 6), pack-reused 0
Receiving objects: 100% (29/29), 23.72 KiB | 1.13 MiB/s, done.
Resolving deltas: 100% (12/12), done.
error: failed to get `bliss-audio` as a dependency of package `bliss-analyze v0.1.0 (/var/cache/private/pamac/musicplayerplus/src/musicplayerplus/bliss-analyze)`

Caused by:
  failed to create directory `/.cargo/registry/index/github.com-1ecc6299db9ec823`

Caused by:
  Read-only file system (os error 30)
==> ERROR: A failure occurred in prepare().
    Aborting...
Finished with result: exit-code
Main processes terminated with: code=exited/status=4
Service runtime: 15.633s
CPU time consumed: 10.092s
doctorfree commented 1 year ago

Thanks for the report. These look like two different errors. The first appears to be a permissions problem and is likely the result of a recent change I made to the PKGBUILD for musicplayerplus. I was told not to use sudo in PKGBUILD but it appears it may be needed in this case (?). The second is a missing dependency and I have not seen this before.

I will investigate both.

doctorfree commented 1 year ago

@JOJ0 I was unable to replicate your errors on my first try but re-examining your logs I note that at the end of the text console attempt there was an error: Read-only file system. The failures in both attempts are occurring when attempting to write to /usr/lib/ in the graphical install and /.cargo/... in the text install.

Does your system have a read-only root filesystem?

I will continue to look into this but wanted to confirm with you the state of the root filesystem.

JOJ0 commented 1 year ago

Hi, thanks for looking into it. I double checked:

$ mount | grep root        
/dev/mapper/manjaro-root on / type ext4 (rw,noatime)

$ df -h | grep root
/dev/mapper/manjaro-root     63G   57G  3,8G  94% /
JOJ0 commented 1 year ago

I'm realising that /.cargo/.... is a very untypical path to write to in general. Usually no hidden dirs in /

doctorfree commented 1 year ago

Thanks for confirming the root filesystem is read/write. I guess that error message was misleading.

Yes, the /.cargo/... path is weird. The PKGBUILD performs a Cargo build of blissify and bliss-analyze. Cargo packages are downloaded as part of those builds but they should go in $HOME/.cargo/.... It could be another misleading error message.

I have been working on a major new release of MusicPlayerPlus in which many of the components are split out into their own separate packages. This modular approach moves much of the over-complicated prep and build out of PKGBUILD and into the mppinit utility used to perform initial configuration of MusicPlayerPlus. It also gives users more flexibility and control over which components get installed - don't want or need Blissify, don't install it.

This revised modular architecture will address the issues you raise here. I'm pretty close to having MusicPlayerPlus version 3 ready but need to run it through test. I should have something by end of year (i'm unavailable for some of the holidays).

doctorfree commented 1 year ago

When packaging the Bliss binary builds for Arch I tried to follow the package guidelines at https://wiki.archlinux.org/title/Rust_package_guidelines

I'm reviewing these and leaving this note here for myself when I get time to investigate further. Note that the guidelines state that Arch repository packages are built in chroot environments with default settings. This may be the source of the /.cargo/... path in the log. Or, perhaps this build is not being performed in a chrooted env and thus the permissions errors.

doctorfree commented 1 year ago

Version 3.0.0 Release 2 may avoid this issue. See https://github.com/doctorfree/MusicPlayerPlus/releases/tag/v3.0.0r2

JOJ0 commented 1 year ago

Hi, I just removed all the old mpplus packages and downloaded 3.0.0.r2 and installed as stated in the release notes. I'm missing the essentia_streaming_extractor stuff now. You once mentionend that it is now in an extra package, right? Where to find that package? Cheers!

JOJ0 commented 1 year ago

Found it. This almost did the trick. Getting a signature error:

$ sudo pamac install https://github.com/doctorfree/mpplus-essentia/releases/download/v1.0.1r1/mpplus-essentia-v1.0.1r1-1-x86_64.pkg.tar.zst
Preparing...
Downloading mpplus-essentia (v1.0.1r1-1)...                                                  
Error: Failed to prepare transaction: package missing required signature                     
JOJ0 commented 1 year ago

First downloading and then installing from there works fine:

$ sudo pamac install Downloads/mpplus-essentia-v1.0.1r1-1-x86_64.pkg.tar.zst
Preparing...
Resolving dependencies...
Checking inter-conflicts...

To install (1):
  mpplus-essentia  v1.0.1r1-1      

Total installed size: 160,0 MB

Apply transaction ? [y/N] y
Checking keyring...                                                                     [1/1]
Checking integrity...                                                                   [1/1]
Loading packages files...                                                               [1/1]
Checking file conflicts...                                                              [1/1]
Checking available disk space...                                                        [1/1]
Installing mpplus-essentia (v1.0.1r1-1)...                                              [1/1]
Additional info at:
  - https://github.com/doctorfree/mpplus-essentia#readme
Running post-transaction hooks...
Arming ConditionNeedsUpdate...                                                          [1/2]
Refreshing PackageKit...                                                                [2/2]
Transaction successfully finished. 
JOJ0 commented 1 year ago

I closed this one since the initially reported error is fixed. Probably a new one should be openend for the missing dependency/optional dependdncy to mpplus-essentia?

doctorfree commented 1 year ago

Yes, a new issue regarding mpplus-essentia installation may be necessary. It is supposed to get installed when mppinit is run after completing the MusicPlayerPlus package install. I will do some testing today to see why that didn't happen.

Did mpcplus get installed?

doctorfree commented 1 year ago

I was initially unable to replicate the mpplus-essentia failure to install you report here. The mpplus-essentia package was successfully installed during mppinit after installing the MusicPlayerPlus package. When you run mppinit you should see something like the following:

Initializing MusicPlayerPlus, please wait ...
    Installing mpcplus ...
    Installing mpplus-essentia ...
    Installing mpplus-bliss ...

Please open an issue if this continues to be a problem or if you have additional details of the mppinit run that might be helpful.

I will continue to investigate and I did find other things that need to be corrected so there will be a new package in a few days.

doctorfree commented 1 year ago

Ok, I was able to replicate the mpplus-essentia install error. It seems to be a missing signature causing the install to fail. I was able to replicate the problem by rolling my Arch VM back to an initial state before testing.

I will open an issue and begin work on this tomorrow. Thanks for bringing this to my attention, I would not have encountered this on my own. Feel free to school me on how to distribute signed Arch packages.

doctorfree commented 1 year ago

@JOJ0 the mpplus-essentia installation on Arch has been fixed in MusicPlayerPlus version 3.0.1 release 1 along with your PR providing support for Manjaro and other Arch-like platforms.