Score:0

Error installing mongodb on debian 11 in proxmox container

nz flag

I try to install mongodb on Debian 11 in a proxmox VE 7.1 container as described in this tutorial https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/

But I get the following error:

error setting ownership of './usr/bin/bsondump': Invalid argument
uname -a
Linux chat 5.13.19-2-pve #1 SMP PVE 5.13.19-4 (Mon, 29 Nov 2021 12:10:09
+0100) x86_64 GNU/Linux

Here the full log:

root@chat:~# apt install mongodb-org
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  mongodb-database-tools mongodb-mongosh mongodb-org-database mongodb-org-database-tools-extra mongodb-org-mongos
  mongodb-org-server mongodb-org-shell mongodb-org-tools 
The following NEW packages will be installed:
  mongodb-database-tools mongodb-mongosh mongodb-org mongodb-org-database mongodb-org-database-tools-extra mongodb-org-mongos
  mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 9 newly installed, 0 to remove and 1 not upgraded.
Need to get 142 MB of archives.
After this operation, 455 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-database-tools amd64 100.5.2 [46.4 MB]
Get:2 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-mongosh amd64 1.4.2 [36.0 MB]
Get:3 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-shell amd64 5.0.8 [14.4 MB]
Get:4 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-server amd64 5.0.8 [26.3 MB]
Get:5 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-mongos amd64 5.0.8 [18.5 MB]
Get:6 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-database-tools-extra amd64 5.0.8 [7752 B]
Get:7 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-database amd64 5.0.8 [3540 B]
Get:8 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org-tools amd64 5.0.8 [2896 B]
Get:9 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0/main
amd64 mongodb-org amd64 5.0.8 [2932 B] Fetched 142 MB in 13s (10.6
MB/s)                                                                                                
 
(Reading database ... 28040 files and directories currently installed.) Preparing to unpack .../0-mongodb-database-tools_100.5.2_amd64.deb ...
Unpacking mongodb-database-tools (100.5.2) ...
dpkg: error processing archive
/tmp/apt-dpkg-install-qgvHOt/0-mongodb-database-tools_100.5.2_amd64.deb
(--unpack):
 error setting ownership of './usr/bin/bsondump': Invalid argument
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) Selecting previously unselected package mongodb-mongosh.
Preparing to unpack .../1-mongodb-mongosh_1.4.2_amd64.deb ...
Unpacking mongodb-mongosh (1.4.2) ...
Selecting previously unselected package mongodb-org-shell.
Preparing to unpack .../2-mongodb-org-shell_5.0.8_amd64.deb ...
Unpacking mongodb-org-shell (5.0.8) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../3-mongodb-org-server_5.0.8_amd64.deb ...
Unpacking mongodb-org-server (5.0.8) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../4-mongodb-org-mongos_5.0.8_amd64.deb ...
Unpacking mongodb-org-mongos (5.0.8) ...
Selecting previously unselected package mongodb-org-database-tools-extra.
Preparing to unpack
.../5-mongodb-org-database-tools-extra_5.0.8_amd64.deb ...
Unpacking mongodb-org-database-tools-extra (5.0.8) ...
Selecting previously unselected package mongodb-org-database.
Preparing to unpack .../6-mongodb-org-database_5.0.8_amd64.deb ...
Unpacking mongodb-org-database (5.0.8) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../7-mongodb-org-tools_5.0.8_amd64.deb ...
Unpacking mongodb-org-tools (5.0.8) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../8-mongodb-org_5.0.8_amd64.deb ...
Unpacking mongodb-org (5.0.8) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-qgvHOt/0-mongodb-database-tools_100.5.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

What is causing this error?

Nikita Kipriyanov avatar
za flag
Please, show a container definition (the contents of `/etc/pve/lxc/ID.conf`). In general this problem may be is caused by the fact you [can't freely manipulate ACLs and the like](https://forum.proxmox.com/threads/can-not-chown-folder-or-file-in-unprivileged-lxc-container-proxmox-ve-6-2.78791/) in unprivileged LXC containers, but this depends on the container configuration.
user12682985 avatar
nz flag
Yes, it is an unprivileged container
Score:0
nz flag

I changed the container from unprivileged to privileged

  1. made a backup of the original unprivileged container 113
  2. made a new privileged container 117 from the backup

pct restore 117 /var/lib/vz/dump/vzdump-lxc-113-2022_05_30-10_13_11.tar.zst --storage local-lvm --unprivileged 0

Now I can install mongodb without errors

Nikita Kipriyanov avatar
za flag
Please accept your own answer so others may find it and readily apply your solution.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.