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

what(): Malformed file (Koofr) #176

Closed
ariealerr opened this issue Aug 5, 2024 · 7 comments
Closed

what(): Malformed file (Koofr) #176

ariealerr opened this issue Aug 5, 2024 · 7 comments
Milestone

Comments

@ariealerr
Copy link

Searched through the issues and couldn't find this anywhere.

Recently ran pacman -Syu to update packages, and then j4-dmenu-desktop stopped working. I believe j4dd was updated with the rest of the packages.

> j4-dmenu-desktop
terminate called after throwing an instance of 'std::runtime_error'
  what(): Malformed file
fish: Job 1, 'j4-dmenu-desktop' terminated by signal SIGABRT (Abort)

The j4dd menu appears as normal, but nothing is listed. I can include binaries the same way as listed in the README, but trying to run them does nothing.

Things I've tried:

  • Reinstalling j4dd
  • Building j4dd myself
  • Rebuilding dmenu

EndeavourOS
6.10.2-arch1-2

I'm assuming the problem lies somewhere in my packages or my system configurations, and not in j4dd. I don't sync nearly often enough as I should. Not sure what to do about it though, nothing else has been affected by the update as far as I've noticed.

@meator
Copy link
Collaborator

meator commented Aug 5, 2024

Can you please post debug output (using the --log-level DEBUG flag)?

@linnabraham
Copy link

I had the same issue. When I used @meator 's suggestion, I could easily find the problematic desktop file. It belonged to a cloud service which I had recently uninstalled. But the desktop file was still around since it didn't have a proper uninstaller. Removing the file solved my problem.

@linnabraham
Copy link

linnabraham commented Aug 11, 2024

On a different machine where I had the application still installed, I get the same error.
This is the relevant part of the output with logging enabled.

Renaming this desktop file solves the issue. But then I won't be able to use the desktop launcher.

[2024-08-11 14:17:51.641] [debug] [main.cc:1362]    /usr/share/applications/carta.desktop
[2024-08-11 14:17:51.641] [debug] [main.cc:1362]    /usr/share/applications/electron28.desktop
[2024-08-11 14:17:51.641] [debug] [main.cc:1362]    /usr/share/applications/obsidian.desktop
[2024-08-11 14:17:51.641] [debug] [main.cc:1362]    /usr/share/applications/djvusmooth.desktop
[2024-08-11 14:17:51.642] [debug] [main.cc:1367] Found 1 locale suffixes:
[2024-08-11 14:17:51.642] [debug] [main.cc:1369]  C
[2024-08-11 14:17:51.642] [debug] [AppManager.cc:74] AppManager: Entered AppManager
[2024-08-11 14:17:51.642] [debug] [AppManager.cc:89] AppManager: Processing rank -> 0 <- (base: /home/linn/.local/share/applications/)
[2024-08-11 14:17:51.642] [debug] [AppManager.cc:95] AppManager:   Handling file '/home/linn/.local/share/applications/appimagekit-pcloud.desktop' ID: appimagekit-pcloud.desktop
[2024-08-11 14:17:51.642] [debug] [AppManager.cc:95] AppManager:   Handling file '/home/linn/.local/share/applications/koofr.desktop' ID: koofr.desktop
terminate called after throwing an instance of 'std::runtime_error'
  what():  Malformed file.
zsh: IOT instruction (core dumped)  j4-dmenu-desktop --log-level=DEBUG

Content of the desktop file in question

[Desktop Entry]
  Name=Koofr
  GenericName=Hybrid storage cloud
  Exec=/home/linn/.koofr-dist/storagegui
  Terminal=false
  Type=Application
  Icon=/home/linn/.koofr-dist/icon.png
  Categories=Network;FileTransfer;Internet;

meator added a commit that referenced this issue Aug 11, 2024
Exceptions should be more informative now. Invalid desktop files now
fall under invalid_error and are handled gracefully instead of aborting
j4-dmenu-desktop.

related to #176
@meator
Copy link
Collaborator

meator commented Aug 11, 2024

Desktop files may not contain spaces before the key. I believe this is against the Desktop entry specification. Please ask Koofr to fix their desktop file. You can remove the whitespace before all keys to fix it:

[Desktop Entry]
Name=Koofr
GenericName=Hybrid storage cloud
Exec=/home/linn/.koofr-dist/storagegui
Terminal=false
Type=Application
Icon=/home/linn/.koofr-dist/icon.png
Categories=Network;FileTransfer;Internet;

Desktop files with invalid key=value pairs should now get treated the same as other types of invalid desktop files. j4-dmenu-desktop built from the develop branch should print a warning about the faulty desktop file, skip it and continue working instead of aborting.

@meator meator changed the title what(): Malformed file what(): Malformed file (Koofr) Aug 11, 2024
@ariealerr
Copy link
Author

Can you please post debug output (using the --log-level DEBUG flag)?

Thanks! That helped identify the issue. One of the desktop files were indeed causing errors, but for me not by Koofr.

@meator
Copy link
Collaborator

meator commented Oct 13, 2024

@Swexti Would you mind posting the faulty desktop file here?

@ariealerr
Copy link
Author

@Swexti Would you mind posting the faulty desktop file here?

Sorry, I removed the desktop file. I can't remember what it was.

@meator meator added this to the r3.2 milestone Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants