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

Handle container install failure #193

Closed
deeplow opened this issue Aug 22, 2022 · 5 comments · Fixed by #952
Closed

Handle container install failure #193

deeplow opened this issue Aug 22, 2022 · 5 comments · Fixed by #952
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@deeplow
Copy link
Contributor

deeplow commented Aug 22, 2022

The install_container() method returns false when it fails but none of its calls check the return value.

This should also be passed on to the user interface so the user can see the issue.

@deeplow
Copy link
Contributor Author

deeplow commented Sep 7, 2022

Failure cause: Disk is Full

I am getting a similar issue to #152 but I think that is a consequence of this lack of failure handling.

In short, the instalation fails saying Error: payload does not match any of the supported image formats (oci, oci-archive, dir, docker-archive) but nothing is communicated via the user interface. It only shows the following error:

dez3

After digging runnning the volume instalation command with --log-level debug I saw this was related to full disk size and expanding it did solve the issue.

Before increasing disk size

$ dangerzone
[INFO] Installing Dangerzone container image...
Getting image source signatures
Copying blob 48a31ab7de6f [=====================>----------------] 900.8MiB / 1.5GiB
Copying blob b56b9d864269 done  
Copying blob 64a1a52c74ff done  
Copying blob 4965dc1ce878 done  
Copying blob 99f8e046e98a done  
Copying blob 994393dc58e7 skipped: already exists  
Error: payload does not match any of the supported image formats (oci, oci-archive, dir, docker-archive)
[ERROR] Failed to install the container image
[INFO] > /usr/bin/podman run --network none -u dangerzone --security-opt no-new-privileges --userns keep-id --cap-drop all --rm -v /home/user/dangerzone/test_docs/sample.doc:/tmp/input_file -v /home/user/.config/dangerzone/tmp/tmprkiz5sfc/pixels:/dangerzone dangerzone.rocks/dangerzone /usr/bin/python3 /usr/local/bin/dangerzone.py document-to-pixels
[ERROR] Invalid JSON returned from container: Trying to pull dangerzone.rocks/dangerzone:latest...

[ERROR] Invalid JSON returned from container: Error: initializing source docker://dangerzone.rocks/dangerzone:latest: pinging container registry dangerzone.rocks: invalid status code from registry 404 (Not Found)

[ERROR] documents-to-pixels failed
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda3      9.6G  6.6G  2.5G  73% /
none            9.6G  6.6G  2.5G  73% /usr/lib/modules
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           1.0G   84K  1.0G   1% /dev/shm
tmpfs            58M  760K   57M   2% /run
tmpfs           1.0G  4.0K  1.0G   1% /tmp
/dev/xvdb        50G  8.8G   42G  18% /rw
tmpfs            29M  144K   29M   1% /run/user/1000

After increasing disk size

All went fine when I changed the root volume from 10GiB to 15GiB.

$ dangerzone
[INFO] Installing Dangerzone container image...
Getting image source signatures
Copying blob b56b9d864269 done  
Copying blob 48a31ab7de6f done  
Copying blob 64a1a52c74ff done  
Copying blob 4965dc1ce878 done  
Copying blob 99f8e046e98a done  
Copying blob 994393dc58e7 skipped: already exists  
Copying config a5ffd1129f done  
Writing manifest to image destination
Storing signatures
Loaded image(s): dangerzone.rocks/dangerzone:latest
[INFO] Container image installed
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda3       15G  6.7G  7.2G  49% /
none             15G  6.7G  7.2G  49% /usr/lib/modules
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           1.0G   84K  1.0G   1% /dev/shm
tmpfs            58M  760K   57M   2% /run
tmpfs           1.0G  456K  1.0G   1% /tmp
/dev/xvdb        50G   12G   39G  24% /rw
tmpfs            29M  148K   29M   1% /run/user/1000

deeplow added a commit that referenced this issue Sep 15, 2022
Note: the container installation failure is not addressed here. See
#193
@eloquence eloquence added this to the 0.5.0 milestone Sep 15, 2022
@deeplow
Copy link
Contributor Author

deeplow commented Jan 13, 2023

A way to reproduce this is to have a corrupt container image.

@deeplow
Copy link
Contributor Author

deeplow commented Mar 29, 2023

Actually, this is more what an corrupted installer failure looks like when running Dangerzone for the first time:

  • first it shows "installing container image"

  • and then this screen:

    dzz

This issue happened to my on the dev environment. It's not too concerning. I happened as a consequences of this other one #380.

@apyrgio
Copy link
Contributor

apyrgio commented Feb 14, 2024

One other way that improper error handling bites us is when the container image is corrupted (possible only on dev environments).

How to reproduce:

  1. Create an invalid tar file (e.g. an empty file),
  2. gzip it, and store it as share/container.tar.gz, and
  3. run the Dangerzone GUI

The user will not see an error in their screen, because we don't handle them:

self.dangerzone.isolation_provider.install()

@deeplow deeplow added the good first issue Good for newcomers label Mar 7, 2024
@apyrgio apyrgio assigned apyrgio and unassigned apyrgio May 21, 2024
@apyrgio apyrgio modified the milestones: Bookmarks, 0.8.0 Jul 31, 2024
@apyrgio
Copy link
Contributor

apyrgio commented Jul 31, 2024

Another dev has recently bumped into this issue (see #883), which means we should prioritize it. After all, it's not that much work.

Adding it tentatively in the 0.8.0 milestone as a stretch goal.

almet added a commit that referenced this issue Oct 14, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 15, 2024
almet added a commit that referenced this issue Oct 17, 2024
almet added a commit that referenced this issue Oct 17, 2024
@almet almet closed this as completed in a95b612 Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants