Problem with Advanced MATE menu on Ubuntu Mate 18.04

Hi All,
I have a problem with the advanced MATE menu, which I think might be a bug. I installed 4kvideodownloader from the 64bit .deb file on https://www.4kdownload.com/ and found that it worked OK when invoked from the main MATE menu and custom menu bar but when I tried launching it from the advanced MATE menu, nothing happened. Further, if I right click the application in the advanced MATE menu and add it to the panel and the desktop, it will launch OK from both of these locations.
I repeated the test with a live USB stick in case my installed system had somehow got corrupted, and this gave exactly the same results.
Please can someone advise?
Many thanks,
Tony

1. Analysis

I can confirm that it does not start from Advanced MATE Menu, but starts normally from Brisk Menu, Main Menu and Menu Bar applets and from Panel and Desktop launchers.

We can locate and investigate its desktop-file:

$ which 4kvideodownloader 
/usr/bin/4kvideodownloader

$ file /usr/bin/4kvideodownloader
/usr/bin/4kvideodownloader: symbolic link to /usr/lib/4kvideodownloader/4kvideodownloader.sh

$ ls -al /usr/bin/4kvideodownloader
lrwxrwxrwx 1 root root 47 июл 18 20:39 /usr/bin/4kvideodownloader -> /usr/lib/4kvideodownloader/4kvideodownloader.sh

$ dpkg -L 4kvideodownloader | grep desktop$
/usr/share/applications/4kvideodownloader.desktop

$ cat /usr/share/applications/4kvideodownloader.desktop
[Desktop Entry]
Name=4K Video Downloader
GenericName=4K Video Downloader
Comment=Download online video
Exec=4kvideodownloader
Terminal=false
Type=Application
Icon=4kvideodownloader.png
Categories=Network;Qt;

What is strange - they have leading space in the executable file:

$ cat /usr/lib/4kvideodownloader/4kvideodownloader.sh
 #!/bin/sh
 
 LD_LIBRARY_PATH=/usr/lib/4kvideodownloader
 export LD_LIBRARY_PATH
 
 /usr/lib/4kvideodownloader/4kvideodownloader-bin $*

Its icon is always shown, it is shown in correct place. But Exec line is fails only for advanced menu.
From /var/log/syslog we can see the error message produced after clicking on menu:

$ tail -f /var/log/syslog
Jul 18 21:00:30 bionic org.mate.panel.applet.MateMenuAppletFactory[1305]: message repeated 20 times: [ TypeError: Couldn't find foreign struct converter for 'cairo.Context']
Jul 18 21:00:35 bionic org.mate.panel.applet.MateMenuAppletFactory[1305]: 4kvideodownloader
Jul 18 21:00:35 bionic org.mate.panel.applet.MateMenuAppletFactory[1305]: [Errno 8] Exec format error
Jul 18 21:00:35 bionic org.mate.panel.applet.MateMenuAppletFactory[1305]: TypeError: Couldn't find foreign struct converter for 'cairo.Context'

I can remove error messages about cairo.Context by installing related python-packages:

sudo apt-get install python-cairo python-gi-cairo

But it does not help.

2. Solution

The real problem is leading spaces in shell file.
If we remove spaces, then program will start normally:

sudo sed -i 's/^ //' /usr/lib/4kvideodownloader/4kvideodownloader.sh 

You should contact the 4kdownload's software developers directly to inform them about their error.
All other their applications (4kslideshowmaker, 4kstogram, 4kvideotomp3, 4kyoutubetomp3) are affected by this problem too.

2 Likes

Re: [Ubuntu MATE Community] [Support & Help Requests]
Problem with Advanced MATE menu on Ubuntu Mate 18.04
Dear Norbert,

Many thanks for your solution!

I'll let the 4kvideodownloader support team know

Kind regards,

Tony

1 Like