User avatar
edgar-bonet
Posts: 3
Joined: Thu Jul 26, 2018 10:31 am
Location: Grenoble, France

Upgraded nodejs makes some packages uninstallable

Thu Jul 26, 2018 11:05 am

Hello!

I created an account to report here a problem I had with the Raspbian provided by the foundation. I am not sure this is the right place. If it's not, could someone please show me the right door?

I am running the latest Raspbian Stretch Lite (foundation image dated June 2018) on a Pi 3 model B. I noticed that a recent "apt upgrade" upgraded the package nodejs from version 4.8.2 to version 8.11.1. Having a newer Node.js seems all nice. Unfortunately, there are quite a few packages that worked before but are now uninstallable. For example:

Code: Select all

[email protected]:~ $ sudo apt install node-iconv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 node-iconv : Depends: nodejs-abi-46
E: Unable to correct problems, you have held broken packages.
As shown in the error message above, the problem is that the nodejs-abi-46 virtual package, which nodejs 4.8.2 used to provide, is not provided by nodejs 8.11.1. Every package that, directly or indirectly, depends on nodejs-abi-46 cannot be installed anymore.

Interestingly, it appears that the upgraded nodejs was uploaded to archive.raspberrypi.org which, if I understand correctly, holds only software provided by the Raspberry Pi foundation specifically for the Raspberry Pi. Both raspbian.raspberrypi.org and archive.raspbian.org (the official Raspbian archive) only distribute version 4.8.2. Debian does provide a nodejs 8.11.1, but it does so in its stretch-backports archive, not in the regular stretch archive.

It looks to me like the decision to provide nodejs 8.11.1 as a regular upgrade was an error of the Raspberry Pi foundation. Using backports always carries the risk of hitting this kind of incompatibilities, that's why the backports repos are never enabled by default: using them is a decision a user can only make at his own risk.

So my questions are: Is the Raspberry Pi foundation aware of this problem? Are they going to try to fix it? How?

Notes:
  1. I am not asking for personal help (I can work around the issue on my own), I am reporting what, to my eyes, seems like a packaging bug.
  2. I first discussed this issue on raspberrypi.stackexchange.com: Why does 'apt install node-body-parser' fail?
  3. I tried to establish the list of affected packages (I may have missed some): groovebasin, libjs-jssip, libjs-websocket, node-body-parser, node-flashproxy, node-groove, node-iconv, node-jssip, node-leveldown, node-mapnik, node-mbtiles, node-millstone, node-node-expat, node-node-stringprep, node-raw-body, node-sqlite3, node-srs, node-tilejson, node-tilelive-bridge, node-tilelive-mapnik, node-tilelive-vector, node-websocket, node-ws, node-zmq.
Regards,

Edgar.

bertlea
Posts: 282
Joined: Wed Dec 07, 2016 6:33 am
Location: Hong Kong

Re: Upgraded nodejs makes some packages uninstallable

Mon Jul 30, 2018 8:15 am

Node.js v4.x is outdated and is not even in maintenance mode as of end April 2018. I think it is a mistake for Raspbian to include Node.js v4.x in the Raspbian installation package.

I personally like the feature that Raspbian automatically updates my Node.js to the latest version when I do apt-get update.

DirkS
Posts: 9899
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Upgraded nodejs makes some packages uninstallable

Mon Jul 30, 2018 10:22 am

bertlea wrote:
Mon Jul 30, 2018 8:15 am
Node.js v4.x is outdated and is not even in maintenance mode as of end April 2018. I think it is a mistake for Raspbian to include Node.js v4.x in the Raspbian installation package.

I personally like the feature that Raspbian automatically updates my Node.js to the latest version when I do apt-get update.
Raspbian follows Debian and the latest version is 4.8.
The RPF stretch repo is more up to date and currently installs 8.11
Only the Node repo will get you a slightly more recent install

Code: Select all

[email protected]:~ $ apt-cache policy nodejs
nodejs:
  Installed: 8.11.3-1nodesource1
  Candidate: 8.11.3-1nodesource1
  Version table:
 *** 8.11.3-1nodesource1 500
        500 https://deb.nodesource.com/node_8.x stretch/main armhf Packages
        100 /var/lib/dpkg/status
     8.11.1~dfsg-2~bpo9+1 500
        500 http://archive.raspberrypi.org/debian stretch/main armhf Packages
     4.8.2~dfsg-1 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5857
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Upgraded nodejs makes some packages uninstallable

Tue Jul 31, 2018 9:01 am

Thanks for reporting it. I did brief testing of a handful of nodejs packages before pushing the update out, but none of these were on the list. I'll add it to the todo list.

User avatar
edgar-bonet
Posts: 3
Joined: Thu Jul 26, 2018 10:31 am
Location: Grenoble, France

Re: Upgraded nodejs makes some packages uninstallable

Tue Jul 31, 2018 7:25 pm

ShiftPlusOne wrote:
Tue Jul 31, 2018 9:01 am
[...] I'll add it to the todo list.
Thank-you ShiftPlusOne.

In case it may help, here is how I tried to get the list of affected packages. First, I typed

Code: Select all

apt-cache showpkg nodejs-abi-46
And took note of the packages listed under “Reverse Depends”. There were 12 of them: libjs-websocket, node-zmq, node-ws, node-websocket, node-srs, node-sqlite3, node-node-stringprep, node-node-expat, node-mapnik, node-leveldown, node-iconv, and node-groove. Let's call this the “short list”.

Then, I recursively listed the packages that depend on those from the short list:

Code: Select all

apt-cache rdepends --no-recommends --no-suggests --recurse $short_list \
    | grep '^  ' | sort | uniq
Then I merged the lists, and made sure that every package on the combined list does indeed cause an error by running, for every one of them:

Code: Select all

apt install -s $package
I believe only the packages from the short list above need to be upgraded. Those are the ones that explicitly depend on the old Node.js ABI. But then I am no APT expert...

Best regards,

Edgar.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5857
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Upgraded nodejs makes some packages uninstallable

Tue Jul 31, 2018 7:29 pm

Yup, that was my approach as well. The rebuild of the necessary packages was mostly automated. However, it helped uncover another issue with the ffmpeg package, which ended up taking a big chunk of the day to fix. Hopefully a new set of fixed packages should be available this week.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5857
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Upgraded nodejs makes some packages uninstallable

Wed Aug 01, 2018 12:05 pm

I've pushed the updates out. It may take a while for the load balancers to sync up.

Can't guarantee that all the packages work as intended, but they should at least be installable.

User avatar
edgar-bonet
Posts: 3
Joined: Thu Jul 26, 2018 10:31 am
Location: Grenoble, France

Re: Upgraded nodejs makes some packages uninstallable

Wed Aug 01, 2018 1:51 pm

This does fix the issue for me: I removed the workaround I had, and everything works fine again. So I guess I can report that at least node-body-parser, which relies now on the updated node-iconv, works as expected.

I am impressed by the speedy response. Let me address a big thanks to ShiftPlusOne, and those involved in rolling out this fix!

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5857
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Upgraded nodejs makes some packages uninstallable

Wed Aug 01, 2018 2:20 pm

No problem at all. Thanks again for reporting the issue.

Return to “Raspbian”