Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Impossible to create a libertine container #1305

Closed
ernesst opened this issue Nov 25, 2019 · 15 comments · Fixed by ubports/libertine#104
Closed

Impossible to create a libertine container #1305

ernesst opened this issue Nov 25, 2019 · 15 comments · Fixed by ubports/libertine#104

Comments

@ernesst
Copy link

ernesst commented Nov 25, 2019

  • Device: OP3
  • Channel: Edge
  • Build: 19-11-25

Steps to reproduce

Try to create a Libertine container

Expected behavior

Able to create a container from the gui or the terminal, as per http://docs.ubports.com/en/latest/userguide/dailyuse/libertine.html

Actual behavior

the gui comes back to the main container creation screen after validating name of the container.

Logfiles and additional information

`phablet@ubuntu-phablet:~$ libertine-container-manager list

phablet@ubuntu-phablet:~$ libertine-container-manager create -i xenial

Enter password for your user in the Libertine container or leave blank for no password:

Password:

libertine-container-manager:123: ERROR: create(): Failed to create container: 'No module named 'libertine.LxcContainer''
`

@ernesst
Copy link
Author

ernesst commented Nov 25, 2019

This command seems to produce a container :
libertine-container-manager create --id test --type chroot --name 'Libertine Demo'
but fails on initializing makedev
https://paste.ubuntu.com/p/tjdmNMwkTt/

Command from this bug test : https://bugs.launchpad.net/ubuntu/+source/libertine/+bug/1556303

@lakotaubp
Copy link

I can confirm this. Try to setup from system settings, tap create brief change of page then back to create page.

@Vince1171
Copy link
Member

seems to appear on all Halium based ports

@faissaloo
Copy link

I'm getting this on the Pinephone

@xonq
Copy link

xonq commented Jun 28, 2020

If you create a chroot type container it in the command line, it ultimately fails at some permission error, however, I was then able to view the libertine container in both the cl and settings. I was able to install an app via the settings GUI, and then use it by starting a bash shell in the container libertine-container-manager exec -i $CONTAINER -c /bin/bash

@vuldin
Copy link

vuldin commented Jul 16, 2020

When running the following command:
libertine-container-manager create --type chroot -i vuldin-container

I get lots of output with errors ending in the following:

...
Errors were encountered while processing:
 ca-certificates
 dictionaries-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
ChrootContainer.py:126: ERROR: create_libertine_container(): Failure installing 'apt-transport-https' during container creation
libertine-container-manager:123: ERROR: create():    Failed to create container: 'destroy_libertine_container() missing 1 required positional argument: 'force''

Then trying this command says the container doesn't exist:
libertine-container-manager exec -i vuldin-container -c /bin/bash

@hacker1024
Copy link

I'm getting this too, using a custom kernel (4.14) + the GSI on my Redmi K20 Pro.

@hacker1024
Copy link

sudo apt install python3-libertine* gets me a little further.

libertine-container-manager:123: ERROR: create(): Failed to create container: ''

If I remove the try-catch, here's the stacktrace.

@milikhin
Copy link

milikhin commented Jul 30, 2020

This command seems to produce a container :
libertine-container-manager create --id test --type chroot --name 'Libertine Demo'
but fails on initializing makedev
https://paste.ubuntu.com/p/tjdmNMwkTt/

Command from this bug test : https://bugs.launchpad.net/ubuntu/+source/libertine/+bug/1556303

I'm also getting a similar error about makedev on Pocophone F1 running UBports GSI.
If I understand correctly the issue happens when makedev tries to create various files at /dev/* on its postinstall.
But we already have /dev/ mounted from the host since we are using fakechroot, so makedev gets permission denied when tries to execute rm /dev/sd*.

The issues doesn't happen on my Xperia X as it doesn't have /dev/sd* on the host.

Uninstalling makedev after the debootstrap (here for example) resolves the issue and makes it possible to create a container.

I wonder if we need makedev in a container? Or it could be safely removed?

@milikhin
Copy link

When running the following command:
libertine-container-manager create --type chroot -i vuldin-container

I get lots of output with errors ending in the following:

...
Errors were encountered while processing:
 ca-certificates
 dictionaries-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
ChrootContainer.py:126: ERROR: create_libertine_container(): Failure installing 'apt-transport-https' during container creation
libertine-container-manager:123: ERROR: create():    Failed to create container: 'destroy_libertine_container() missing 1 required positional argument: 'force''

Then trying this command says the container doesn't exist:
libertine-container-manager exec -i vuldin-container -c /bin/bash

Setting TMPDIR=/tmp env var resolves the issue for me: TMPDIR=/tmp libertine-container-manager exec -i vuldin-container -c /bin/bash

@ernesst
Copy link
Author

ernesst commented Aug 22, 2020

When running the following command:
libertine-container-manager create --type chroot -i vuldin-container
I get lots of output with errors ending in the following:

...
Errors were encountered while processing:
 ca-certificates
 dictionaries-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
ChrootContainer.py:126: ERROR: create_libertine_container(): Failure installing 'apt-transport-https' during container creation
libertine-container-manager:123: ERROR: create():    Failed to create container: 'destroy_libertine_container() missing 1 required positional argument: 'force''

Then trying this command says the container doesn't exist:
libertine-container-manager exec -i vuldin-container -c /bin/bash

Setting TMPDIR=/tmp env var resolves the issue for me: TMPDIR=/tmp libertine-container-manager exec -i vuldin-container -c /bin/bash

How are you able to create a container without being destroyed at the end of the installer ?

@milikhin
Copy link

Setting TMPDIR environment variable before executing libertine-container-manager resolves the issue with ca-certificates for me.
It's just: TMPDIR=/tmp libertine-container-manager create --type chroot -i vuldin-container.
Then ca-certificates package is installed successfully and a container is created.

@RoiArthurB
Copy link

RoiArthurB commented Nov 4, 2020

Any update on this issue ?

I freshly install UT on my old OnePlus3 and none of the creation of a container by the 3 methods (GUI, cli, cli w/ TMDIR) works, I have Permission denied errors cause by makedev package 😞

@PeterCxy
Copy link

PeterCxy commented Nov 8, 2020

@RoiArthurB add self.run_in_container('apt remove -y makedev') to line 86 of /usr/lib/python3/dist-packages/libertine/ChrootContainer.py fixed libertine container creation for me. This basically just gets rid of makedev once debootstrap finishes

@RoiArthurB
Copy link

@PeterCxy it works, thanks a lot ! 🙏
Just asking, this quick fix will be erased at the next UBports update, right ?

Vince1171 added a commit to Vince1171/libertine that referenced this issue Feb 16, 2021
fix ubports/ubuntu-touch#1305

while setting up makedev, it tried to access files like /proc/1/environ, and so fail with permission denied
UniversalSuperBox pushed a commit to ubports/libertine that referenced this issue Mar 25, 2021
fix ubports/ubuntu-touch#1305

while setting up makedev, it tried to access files like /proc/1/environ, and so fail with permission denied
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.