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

Inappropriate dependency in deb package #5429

Closed
rosik opened this issue Oct 16, 2020 · 10 comments · Fixed by #6496
Closed

Inappropriate dependency in deb package #5429

rosik opened this issue Oct 16, 2020 · 10 comments · Fixed by #6496
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rosik
Copy link
Contributor

rosik commented Oct 16, 2020

Tarantool version: 2.4.2

$ apt show tarantool tarantool-common                                                                                                                                                   
Package: tarantool 
Version: 2.4.2.0.gcccd89701-1
Depends: ..., tarantool-common (>= 1.7.5.46)

Tarantool dependency on tarantool-common from is specified as >= 1.7.5, while it should be == 2.4.2....

The tarantoolctl binary belongs to the tarantool-common package, but all luarocks modules - to the tarantool. Version inconsistency causes problems.

@Totktonada
Copy link
Member

The idea of tarantool-common and this weak dependency is to don't update init/service files (and restart the daemon) each time tarantool is updated. AFAIK, it is Debian policy to restart a service at update. AFAIR, we can skip restart by using DEB_DH_SYSTEMD* options. Maybe there were no such ability in the past or the idea was to restart tarantool anyway when the entire system is upgraded (and so tarantool-common is updated too).

In short: the weak dependency is right, but the minimal dependency should be bumped when given tarantoolctl version is not compatible with given tarantool version anymore.

@Totktonada
Copy link
Member

Totktonada commented Oct 16, 2020

The problem per se (reported by a user via @rosik to us):

/usr/bin/tarantoolctl:908: module 'luarocks.cfg' not found

So, we should depend on tarantool-common with tarantoolctl with luarocks-3 support for versions of tarantool, which ship luarocks-3.

@Mons
Copy link
Contributor

Mons commented Oct 16, 2020

Maybe better change shipment unit of luarocks module and move it to tarantoolctl package (common)?

@rosik
Copy link
Contributor Author

rosik commented Oct 16, 2020

I would also add that tarantoolctl --help reported 2.4.2, while in fact it was installed from 1.10 package, and it's misleading.

@Totktonada
Copy link
Member

Maybe better change shipment unit of luarocks module and move it to tarantoolctl package (common)?

Seems good on the first glance.

NB: If we'll do, we should correctly set which packages blocks each others to avoid conflicting by files.

@rosik
Copy link
Contributor Author

rosik commented Dec 9, 2020

The same issue just affected @Errora

image

The reason is the old tarantool-common 1.9, apt upgrade fixed it.

@kyukhin kyukhin added bug Something isn't working tmp labels Jul 13, 2021
@Totktonada Totktonada added 1sp and removed teamQ labels Aug 27, 2021
@Totktonada Totktonada assigned mRrvz and unassigned mRrvz Sep 9, 2021
Totktonada added a commit to tarantool/installer.sh that referenced this issue Sep 27, 2021
The situation occurs on Debian Bullseye (where tarantool-2.6 is in the
base repositories), when we enable our repository for tarantool-1.10.

The installer.sh script pins tarantool package from our repository. But
we should pin tarantool-dev package too, otherwise apt-get will unable
to install it:

 | $ apt-get install -y tarantool-dev
 | <...>
 | The following packages have unmet dependencies:
 |  tarantool-dev : Depends: tarantool (= 2.6.0-1) but
 |  1.10.11.0.gf0b0e7ecf-1 is to be installed
 | E: Unable to correct problems, you have held broken pack

We should also pin tarantool-common, otherwise apt-get will install
incorrect version of the package:

 | $ apt-get install -y tarantool
 | <...>
 | $ dpkg -l | grep tarantool
 | ii  tarantool         1.10.11.0.gf0b0e7ecf-1  amd64 <...>
 | ii  tarantool-common  2.6.0-1                 all   <...>
 | ii  tarantool-dev     1.10.11.0.gf0b0e7ecf-1  amd64 <...>

`tarantoolctl rocks` will not work with those tarantool and
tarantool-common versions, see
tarantool/tarantool#5429.

Fixes #10
@DifferentialOrange
Copy link
Contributor

The idea of tarantool-common and this weak dependency is to don't update init/service files (and restart the daemon) each time tarantool is updated. AFAIK, it is Debian policy to restart a service at update. AFAIR, we can skip restart by using DEB_DH_SYSTEMD* options. Maybe there were no such ability in the past or the idea was to restart tarantool anyway when the entire system is upgraded (and so tarantool-common is updated too).

In short: the weak dependency is right, but the minimal dependency should be bumped when given tarantoolctl version is not compatible with given tarantool version anymore.

AFAIK, current deb packages skips restart so this weak dependency is not required anymore

DEB_DH_SYSTEMD_START_ARGS_tarantool-common := --no-restart-on-upgrade tarantool.service

@Totktonada
Copy link
Member

Seems so. #6400 is about that. We want to resolve current problems first, provide updates to Debian's repositories (simple update will not require much attention from Debian developers) and only after this rearrange the packages and propose the new packages structure to review into Debian.

@DifferentialOrange DifferentialOrange self-assigned this Oct 6, 2021
DifferentialOrange added a commit that referenced this issue Oct 6, 2021
Current weak dependency permits using old luarocks with new Tarantool.
Closes #5429
@DifferentialOrange
Copy link
Contributor

DifferentialOrange commented Oct 6, 2021

Issue reproducer

Test container

docker run --name debian_bash --rm -i -t debian:buster bash

Install

apt-get update
apt-get install -y curl
curl -L https://tarantool.io/OtKysgx/release/2.8/installer.sh | bash
apt-get install -y tarantool-common=1.9.1.26.g63eb81e3c-1.1

apt-get install -y tarantool=2.8.2.0.gfc96d10f5-1
tarantool is already the newest version (2.8.2.0.gfc96d10f5-1).

Info

tarantool
Tarantool 2.8.2-0-gfc96d10f5
type 'help' for interactive help
apt-cache policy tarantool
tarantool:
  Installed: 2.8.2.0.gfc96d10f5-1
  Candidate: 2.8.2.0.gfc96d10f5-1
  Version table:
 *** 2.8.2.0.gfc96d10f5-1 1001
        500 https://download.tarantool.org/OtKysgx/tarantool/release/2.8/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status
     2.8.1.0.ge2a1ec0c2-1 1001
        500 https://download.tarantool.org/OtKysgx/tarantool/release/2.8/debian buster/main amd64 Packages
     2.8.0.0.gefc30ccf8-1 1001
        500 https://download.tarantool.org/OtKysgx/tarantool/release/2.8/debian buster/main amd64 Packages
     1.9.1.26.g63eb81e3c-1.1 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
apt-cache policy tarantool-common
tarantool-common:
  Installed: 1.9.1.26.g63eb81e3c-1.1
  Candidate: 2.8.2.0.gfc96d10f5-1
  Version table:
     2.8.2.0.gfc96d10f5-1 500
        500 https://download.tarantool.org/OtKysgx/tarantool/release/2.8/debian buster/main amd64 Packages
     2.8.1.0.ge2a1ec0c2-1 500
        500 https://download.tarantool.org/OtKysgx/tarantool/release/2.8/debian buster/main amd64 Packages
 *** 1.9.1.26.g63eb81e3c-1.1 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status

How to broke

tarantoolctl rocks install luacheck
LuajitError: /usr/bin/tarantoolctl:863: module 'luarocks.cfg' not found:
	no field package.preload['luarocks.cfg']
	no file '/luarocks/cfg.lua'
	no file '/luarocks/cfg/init.lua'
	no file '/luarocks/cfg.so'
	no file '/.rocks/share/tarantool/luarocks/cfg.lua'
	no file '/.rocks/share/tarantool/luarocks/cfg/init.lua'
	no file '/.rocks/lib/tarantool/luarocks/cfg.so'
	no file '/root/.luarocks/share/lua/5.1/luarocks/cfg.lua'
	no file '/root/.luarocks/share/lua/5.1/luarocks/cfg/init.lua'
	no file '/root/.luarocks/share/lua/lua
fatal error, exiting the event loop

DifferentialOrange added a commit that referenced this issue Oct 6, 2021
Current weak dependency permits using old luarocks with new Tarantool.
Closes #5429
DifferentialOrange added a commit that referenced this issue Oct 7, 2021
Promote @Totktonada to be a new maintainer for debian package.
Closes #5429
DifferentialOrange added a commit that referenced this issue Oct 7, 2021
Bump tarantool-common dependency to use luarocks 3.
Current weak dependency permits using old luarocks
with new Tarantool, which causes rocks install to fail.

Closes #5429
DifferentialOrange added a commit that referenced this issue Oct 7, 2021
Bump tarantool-common dependency to use luarocks 3.
Prior to this patch, it was permitted to have
new tarantool package (version >= 2.2.1) installed with
pre-luarocks 3 tarantool-common package (version << 2.2.1).
It caused rocks install to fail.

Closes #5429
DifferentialOrange added a commit that referenced this issue Oct 7, 2021
Promote @Totktonada to be a new maintainer for debian packages.

Closes #5429
@Totktonada Totktonada added this to the 2.8.3 milestone Oct 7, 2021
DifferentialOrange added a commit that referenced this issue Oct 7, 2021
Bump tarantool-common dependency to use luarocks 3.
Prior to this patch, it was permitted to have
new tarantool package (version >= 2.2.1) installed with
pre-luarocks 3 tarantool-common package (version << 2.2.1).
It caused rocks install to fail.

Closes #5429
DifferentialOrange added a commit that referenced this issue Oct 7, 2021
Bump tarantool-common dependency to use luarocks 3.
Prior to this patch, it was permitted to have
new tarantool package (version >= 2.2.1) installed with
pre-luarocks 3 tarantool-common package (version << 2.2.1).
It caused rocks install to fail.

Closes #5429
kyukhin pushed a commit that referenced this issue Oct 14, 2021
Bump tarantool-common dependency to use luarocks 3.
Prior to this patch, it was permitted to have
new tarantool package (version >= 2.2.1) installed with
pre-luarocks 3 tarantool-common package (version << 2.2.1).
It caused rocks install to fail.

Closes #5429
ylobankov pushed a commit to tarantool/installer.sh that referenced this issue Nov 16, 2021
The situation occurs on Debian Bullseye (where tarantool-2.6 is in the
base repositories), when we enable our repository for tarantool-1.10.

The installer.sh script pins tarantool package from our repository. But
we should pin tarantool-dev package too, otherwise apt-get will unable
to install it:

 | $ apt-get install -y tarantool-dev
 | <...>
 | The following packages have unmet dependencies:
 |  tarantool-dev : Depends: tarantool (= 2.6.0-1) but
 |  1.10.11.0.gf0b0e7ecf-1 is to be installed
 | E: Unable to correct problems, you have held broken pack

We should also pin tarantool-common, otherwise apt-get will install
incorrect version of the package:

 | $ apt-get install -y tarantool
 | <...>
 | $ dpkg -l | grep tarantool
 | ii  tarantool         1.10.11.0.gf0b0e7ecf-1  amd64 <...>
 | ii  tarantool-common  2.6.0-1                 all   <...>
 | ii  tarantool-dev     1.10.11.0.gf0b0e7ecf-1  amd64 <...>

`tarantoolctl rocks` will not work with those tarantool and
tarantool-common versions, see
tarantool/tarantool#5429.

Fixes #10
@Totktonada
Copy link
Member

Totktonada commented Dec 3, 2022

This problem was fixed in tarantool 2.10.0.

Package Requires Conflicts
tarantool-2.10.0 tarantool-common >= 2.2.1 tarantool-common (<< 2.2.1)1
tarantool-common-2.10.0 tarantool-common (<< 2.2.1)
tarantool-dev-2.10.0 tarantool (exactly same version) tarantool-common (<< 2.2.1)

That's correct: tarantool-2.10.0, which expects luarocks 3, requires tarantool-common that contains luarocks 3 and conflicts with one that contains luarocks 2.

Let's look on latest 1.10 release:

Package Requires Conflicts
tarantool-1.10.14 tarantool-common >= 1.7.5.46 tarantool-common (<< 1.6~)
tarantool-common-1.10.14 tarantool-common (<< 1.6~)
tarantool-dev-1.10.14 tarantool (exactly same version) tarantool-common (<< 1.6~)

tarantool-1.10.14 requires tarantool-common, but it doesn't specify, whether it needs one with luarocks 2 (tarantool-common << 2.2.1) or one with luarocks 3 (tarantool-common >= 2.2.1). So both combinations are allowed.

It hits users on Debian Bullseye (11) and Ubuntu Jammy (22.04), because it contains tarantool{,-common,-dev}-2.6.0. For example: tarantool/setup-tarantool#36 (starting from words 'tarantoolctl fatal error'). Previous Debian version (Debian Buster, 10) and previous LTS Ubuntu version (Ubuntu Focal, 20.04) offer tarantool 1.9, so there is no 1.10/2.* conflict (unless a user setups two tarantool.org repositories on its own).

Our installer.sh script has some protection against such problems, see tarantool/installer.sh#11 (package origin pinning). But the script is not the only installation method, so on the first glance it looks meaningful to update the control file for tarantool 1.10.

However I don't know, to be honest, whether the fix would actually make users more happy. I guess that without pinning of the installer.sh kind, the packages will anyway updated to 2.6.0 at next apt-get upgrade. So 1.10 user likely pins it on Debian Bullseye/Ubuntu Jammy. But if all the three packages are pinned, the user shouldn't meet the problem.

(In assumption that pinning of the origin will likely solve all the problems transparently for a user, I filed tarantool/doc#3252.)

It is one more confirmation of #6400's point: the separate tarantool-common is error prone.

Footnotes

  1. Strictly less than 2.2.1.

LeonidVas added a commit to tarantool/memcached that referenced this issue Dec 9, 2022
The problem is that on Ubuntu 22.04 luarocks v3 from the
`tarantool-common` package is installed, but tarantoolctl
from tarantool 1.10 uses luarocks v2.
See [1] for more details.

[1] tarantool/tarantool#5429 (comment)
LeonidVas added a commit to tarantool/cartridge-cli that referenced this issue Dec 9, 2022
The problem is that on Ubuntu 22.04 luarocks v3 from the
`tarantool-common` package is installed, but tarantoolctl
from tarantool 1.10 uses luarocks v2.
See [1] for more details.

[1] tarantool/tarantool#5429 (comment)
LeonidVas added a commit to tarantool/cartridge-cli that referenced this issue Dec 9, 2022
The problem is that on Ubuntu 22.04 luarocks v3 from the
`tarantool-common` package is installed, but tarantoolctl
from tarantool 1.10 uses luarocks v2.
See [1] for more details.

[1] tarantool/tarantool#5429 (comment)
LeonidVas added a commit to tarantool/memcached that referenced this issue Dec 12, 2022
The problem is that on Ubuntu 22.04 luarocks v3 from the
`tarantool-common` package is installed, but tarantoolctl
from tarantool 1.10 uses luarocks v2.
See [1] for more details.

[1] tarantool/tarantool#5429 (comment)
0x501D added a commit to tarantool/http that referenced this issue Dec 30, 2022
0x501D added a commit to tarantool/http that referenced this issue Dec 30, 2022
LeonidVas added a commit to tarantool/queue that referenced this issue Feb 28, 2023
The problem is that on Ubuntu 22.04 luarocks v3 from the
`tarantool-common` package is installed, but tarantoolctl
from tarantool 1.10 uses luarocks v2.
See [1] for more details.

[1] tarantool/tarantool#5429 (comment)
LeonidVas added a commit to tarantool/queue that referenced this issue Feb 28, 2023
The problem is that on Ubuntu 22.04 luarocks v3 from the
`tarantool-common` package is installed, but tarantoolctl
from tarantool 1.10 uses luarocks v2.
See [1] for more details.

[1] tarantool/tarantool#5429 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants