PDA

View Full Version : In 20.04 I can't open pdf files attached to emails



FoxJT
June 10th, 2020, 12:27 PM
I have just upgraded to 20.04. Apart from some problems around Xsane (not included?) and my printer, it all seems good.

I use Thunderbird as my email client, and send and receive pdf files as attachments regularly. However, since the upgrade I can no longer open the pdf files directly from Thunderbird. If I do try that, I get an Okular error "Could not open file:///tmp/mozilla_jeremy/<file>.pdf.". If I "Save As" the pdf attachment to a file, I can then open that file from Okular.

Okular seems to be working OK. The problem seems to be either in Thunderbird or Ubuntu. It may be as simple as checking or unchecking a box somewhere! Digging deeper I can't (so far) find an obvious place to correct this.

Any ideas?

Thanks,

Jeremy

SeijiSensei
June 10th, 2020, 01:23 PM
Does the file exist in /tmp/mozilla_jeremy when you open it from Thunderbird?



cd /
ls -l grep tmp


should return

drwxrwxrwt 20 root root 4096 Jun 10 08:09 tmp

An "ls -l /tmp" should reveal the mozilla_jeremy directory. It should have

drwx------ 2 jeremy jeremy 4096 Jun 9 16:42 mozilla_jeremy

Let's make sure all the permissions are right before going to look for something deeper.

CelticWarrior
June 10th, 2020, 03:08 PM
Is Thunderbird or Okular a snap, perhaps?

FoxJT
June 10th, 2020, 04:18 PM
Hi SeijiSensei,

Yes, I should have thought about doing that! Thanks! Yes, my ls -l shows exactly what you described.

What is interesting, though, is that if I try to open that file from Okular it can't see it. When I try that, the directory structure is empty, ie empty screen. If I try to open files under my home directory, no problems. With a bit of fiddling, I can get directory "tmp" to show but no further. Looks like the problem could be permissions, although they look good from ls -l. Incidentally, it should be "mozilla_jeremy0". Not at all critical I assume.

CelticWarrior,

I had never heard of snap. However, I see that snap is a way of completely (?) packaging apps, and running "snap info okular" and "snap info thunderbird" they both have snap-ids. Running "snap info shotwell" gave a "No snap found for shotwell".

What is the significance of this regarding my problem? I am assuming that the two snap packages are potentially incompatible??? If so, what to do next?

CatKiller
June 10th, 2020, 04:31 PM
What is the significance of this regarding my problem?

Snaps are sandboxed from the underlying system, and from each other. There are restricted interfaces for what they're allowed to do.

You might find it easiest to remove the snaps and install standard packages of those applications instead. Otherwise, you could try to configure Thunderbird to put its temporary files in your Home directory instead, which snaps generally have access to.

dino99
June 10th, 2020, 04:32 PM
Are thunderbird and okular the same packages flavour ? Have you mixed Ubuntu with an other DE ?
As i know thunderbird is tested with a gnome system, but okular is not a gnome package but a kde one; which can explain that both can't communicate.

FoxJT
June 10th, 2020, 04:54 PM
They both worked together seamlessly in 18.04. I just upgraded to 20.04 without consciously reloading either package separately. Maybe neither were snaps in 18.04?? No mixing of DEs!

I can't see where to configure Thunderbird to put its pdf files. There is a way to specify files to either be put say in Downloads or always ask. But with pdfs it always opened Okular immediately.

I can remove both apps. However, I see that Okular source is "snapcraft.io". Can I change that?

CelticWarrior
June 10th, 2020, 05:02 PM
All you need is to remove the snap version of Okular - can't read from /tmp - and install the traditional deb version of Okular and it'll work as before.

FoxJT
June 10th, 2020, 05:10 PM
Thanks. Just to confirm, I remove Okular using the Ubuntu Software app. Then download it from okular.kde.org version 19.12.3 )for Ubuntu 20.04).

I'll let you know how I get on!

FoxJT
June 10th, 2020, 05:22 PM
... or maybe not!! Removed OK. However, drilling down there seem to be several versions of 19.12.3. Is there a "cleaner" place to get it. I assume the apt install function will get it from the same place as Ubuntu Software gets it? If not, can you please remind me of the syntax for the "sudo apt install" function. Thanks.

CelticWarrior
June 10th, 2020, 05:35 PM
sudo snap remove okular
sudo apt install okular

FoxJT
June 10th, 2020, 05:39 PM
Found a location here! It also has the install syntax.

https://ubuntu.pkgs.org/20.04/ubuntu-universe-amd64/okular_19.12.3-2ubuntu1_amd64.deb.html

sudo apt-get update
sudo apt-get install okular

Installed OK, and it now works!! Select a pdf file as an email attachment now opens Okular directly!! Who said snap apps was a good idea?

Many thanks to CelticWarrior, dino99, CatKiller and SeijiSensei for all your help!! =d>

SeijiSensei
June 10th, 2020, 09:08 PM
Who said snap apps was a good idea?
Not me. I see problems like yours a few times every week, and they usually come down to snaps having limited access to the filesystem.