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

[Error] xargs parsing error at exporting app #1097

Closed
lrdass opened this issue Dec 11, 2023 · 3 comments · Fixed by #1102
Closed

[Error] xargs parsing error at exporting app #1097

lrdass opened this issue Dec 11, 2023 · 3 comments · Fixed by #1102
Labels
bug Something isn't working

Comments

@lrdass
Copy link

lrdass commented Dec 11, 2023

Describe the bug

distrobox-export --app emacs isn´t working as expected.
it throws the output:

xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option Error: cannot find any desktop files. Error: trying to export a non-installed application.

Trying to debugging it by setting only the folder /usr/share/applications it works properly.
So probably the bug is in one of the queries to find an emacs installation.

 xargs -t -I{} grep -le Exec=.*emacs.* -le Name=.*emacs.* {}

 xargs -t -I{} grep -Le Exec=.*/home/deck/.local/bin/distrobox-enter.* {}

 xargs -t -I{} printf %s@ {}

To Reproduce
Install emacs (ubuntu:latest):
sudo apt-get install emacs

and export it:
distrobox-export --app emacs

Expected behavior
Emacs exported to my local user.

Logs
(I've added the -t verbose tag to xargs to extend the grep command)

+ [ ! -f /run/.containerenv ]
+ grep -q rootless=0 /run/.containerenv
+ id -u
+ [ 1000 -eq 0 ]
+ [ -z emacs ]
+ [ -n emacs ]
+ [ -n  ]
+ [ -n  ]
+ [ -n ubuntu ]
+ container_name=ubuntu
+ [ -z ubuntu ]
+ [ 0 -ne 0 ]
+ container_command_prefix=/home/deck/.local/bin/distrobox-enter  -n ubuntu -- /bin/sh -l -c 
+ [ -z  ]
+ exported_app_label= (on ubuntu)
+ export_application
+ canon_dirs=
+ IFS=:
+ [ -n /home/deck/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share ]
+ [ -d /home/deck/.local/share/applications ]
+ canon_dirs= /home/deck/.local/share/applications
+ [ -n /home/deck/.local/share ]
+ [ -d /home/deck/.local/share/flatpak/exports/share/applications ]
+ canon_dirs= /home/deck/.local/share/applications /home/deck/.local/share/flatpak/exports/share/applications
+ [ -d /var/lib/flatpak/exports/share/applications ]
+ [ -d /usr/local/share/applications ]
+ [ -d /usr/share/applications ]
+ canon_dirs= /home/deck/.local/share/applications /home/deck/.local/share/flatpak/exports/share/applications /usr/share/applications
+ unset IFS
+ find /home/deck/.local/share/applications /home/deck/.local/share/flatpak/exports/share/applications /usr/share/applications -type f -printf %p\n -o -type l -printf "%p"\n
+ xargs -t -I{} grep -le Exec=.*emacs.* -le Name=.*emacs.* {}
+ xargs -t -I{} grep -Le Exec=.*/home/deck/.local/bin/distrobox-enter.* {}
+ xargs -t -I{} printf %s@ {}
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/Steam Linux Runtime.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/pcsx2-Qt.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/DRAGON QUEST XI S Echoes of an Elusive Age  Definitive Edition.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/SHENZHEN IO.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/wine-extension-ini.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/Deep Rock Galactic.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/wine-extension-txt.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/Red Dead Redemption 2.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/wine-extension-vbs.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/CryoUtilities.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/Lovers in a Dangerous Spacetime.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/Ratchet & Clank Rift Apart.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/ubuntu.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/wine-extension-msp.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/wine-extension-pdf.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/STAR WARS Jedi Fallen Order.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/Proton EasyAntiCheat Runtime.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/SRM.desktop
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' '/home/deck/.local/share/applications/ELDEN RING.desktop'
grep -le 'Exec=.*emacs.*' -le 'Name=.*emacs.*' /home/deck/.local/share/applications/wine-extension-htm.desktop
xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
+ desktop_files=
+ [ -z  ]
+ printf Error: cannot find any desktop files.\n
Error: cannot find any desktop files.
+ printf Error: trying to export a non-installed application.\n
Error: trying to export a non-installed application.
+ return 127

podman_log.log

Desktop (please complete the following information):

  • Are you using podman, docker or lilipod?: podman
  • Which version or podman, docker or lilipod? : podman version 4.5.1
  • Which version of distrobox?: distrobox: 1.6.0.1
  • Which host distribution?: SteamOS 3.5
  • How did you install distrobox?: curl + prefix=.local/

Additional context
Context:
I have previously created a debian container and exported another application: VScode.
I had deleted the container (instead of removing the application first) - and the distrobox asked me to --force the deletion of the debian container.
This is the only correlation of cause that happened to this behaviour happen.

  • I've deleted any shortcut previously setted ~/.local/share/applications, searched for any dead symbolic link to any shortcut for code.desktop.
  • Debuged the export program, and it seems that it gets itself lost at some directory.
  • Tried to reinstall every application: distrobox and podman -- no success
  • Deleted the /etc/containers folder and re-downloaded the registries - no success
  • I've also edited the directories for search the applications and have setted manually only to /usr/share/applications and it works properly. So my main idea is that during the search it finds an broken shortcut that returns a bad string that breaks xargs - probably a bad-link generated by the container that got deleted.
@lrdass lrdass added the bug Something isn't working label Dec 11, 2023
@lrdass
Copy link
Author

lrdass commented Dec 13, 2023

Found out what the problem was:
When xargs tried to find if it was already installed at ~/.local/share/applications, some of the games I had installed had a single-quote in the names.
This broke the xargs parsing, and exited as an error.

This issue can still be open to add a chage where it parses program that contains single quotes in the names.

@Alerymin
Copy link

I still get this issue and it prevents me from exporting apps

@AbduEhab
Copy link

AbduEhab commented Nov 7, 2024

This still is an issue it seems. I get the same error when exporting.

image

The problem was the apostrophe in a game's .desktop file name. Removing the file from the /home/deck/.local/share/applications/ directory solved the problem.

image

AbduEhab added a commit to AbduEhab/distrobox that referenced this issue Nov 7, 2024
I ran into an issue when exporting. I mentioned it here: 89luca89#1097 (comment)

I have reworked a small part of the code to utilize the `-0` option of `xargs`
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.

3 participants