Score:10

Updating TOR screwed up my client : "Download Error: 404"

gf flag

it's been ages that Tor browser has that update pop up. Today, because the browser was lagging and freezing/skipping frames while streaming videos, I gave it a shot and updated, it warned me it'll close my running instance and reinstall in the background.

  1. I'm on debian/ubuntu 20.04 KDE. Now the taskbar shortcut won't launch, only open a tiny window showing "Download Error: 404".
  2. When I go to the app menu, sub-menu "Internet", I get the remaining apps "Tor Browser Launcher Settings" and "Tor Browser". I also have a third app, called "Tor Browser" as well. All have the same logo. The two remaining ones lead to that tiny error window, while the third one does launch Tor browser, from which I'm able to post this thread.
  3. I now have "two" Tor, because the third app I'm able to launch is downloaded from torproject website, then I extracted their folder somewhere, opened the terminal here, and did $ ./start-tor-browser.desktop --register-app . So I guess the two former apps were pulled from the apt repository (because installed via the "Discover" KDE GUI).
  4. Before downloading a new instance from torproject website, I tried repairing with sudo apt remove tor torbrowser-launcher -y without the --purge to conserve my bookmarks hopefully, then reinstalled it with sudo apt install tor torbrowser-launcher -y . Which went well, as far as terminal is outputing. But still that error when clicking on the apps...
  5. While right clicking on the non-working "Tor Browser" app and the working one, I notice a difference in commands. The working one does sh -c '"/home/user/softwares/tor-browser/Browser/start-tor-browser" --detach || ([ ! -x "/home/user/softwares/tor-browser/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k , whereas the old apt-pulled app has torbrowser-launcher %u .So out of curiosity, I opened a terminal and typed $ torbrowser-launcher , and there I got this output :
Tor Browser Launcher
By Micah Lee, licensed under MIT
version 0.3.2
https://github.com/micahflee/torbrowser-launcher
Downloading Tor Browser for the first time.
Downloading https://aus1.torproject.org/torbrowser/update_3/release/Linux_x86_64-gcc3/x/en-US
Latest version: 12.0
Downloading https://dist.torproject.org/torbrowser/12.0/tor-browser-linux64-12.0_en-US.tar.xz.asc
Download Error: 404

SO what's wrong with the old instance please ? The URL from which it's trying to pull ?? I'm asking this because on the fresh torproject-pulled instance, the bookmarks I've saved on the apt-pulled browser are missing...

Also when attaching the taskbar shortcut from the working instance, it always end up launching the old instance, hence popping that error window. So I always have to dig into the app menu to click on the third app.

If you guys know how to restore the old instance, OR extract my profile from the old instance to inject in the new one, I'd be thankful

(Found this https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804184 but I quite don't understand since their build seems to be some hardened one...

Also when I do echo $PATH and guess that the torbrowser-launcher file will be in /usr/, and search for that file to modify the URL end from "_en-US" to "_ALL", I really can't find such file to modify. Only some python script which does nothing but import some torbrowser-launcher module...)

guiverc avatar
cn flag
Please provide clear OS & release details... You should have no issues for most releases, but we can't know about specific OS & release until you provide that necessary detail. FYI: Tor browser does work, I use it very regularly (*not quite daily*) and speak with a maintainer somewhat regularly
dejna728 avatar
gf flag
Thank you for answering, done : ubuntu 20.04, fresh install of tor is v12.0, broken one I don't know what version I was using but now that I tried to repair it I pulled whatever latest version from apt repo to this date. Hopefully it's 12.0 as well.
dejna728 avatar
gf flag
Glad to learn it, FYI a parallel investigation is ongoing here : https://www.reddit.com/r/TOR/comments/zic3ta/updating_tor_screwed_up_my_client_download_error/
guiverc avatar
cn flag
This issue maybe related to https://bugs.launchpad.net/ubuntu/+source/torbrowser-launcher/+bug/2000077 which currently is IN PROGRESS with regards fix.
guiverc avatar
cn flag
Upstream issues in Debian have been resolved, and Thomas (teward) now has resolved this issue on *lunar*, and SRU (*stable release update*) request for released products has been started.
Score:17
pn flag

I'm on Ubuntu 22.04, latest update. Installed the torbrowser-launcher from the official repo.

Doing this changes should make the torbrowser-launcher works as expected. But before you do, you must remove this directories ~/.cache/torbrowser, ~/.local/share/torbrowser, ~/.config/torbrowser as they save information for the launcher and the fix won't work using those.

Be aware that if you have a working Tor Browser installation, you will lose your settings and working installations. Using this fix for the torbrowser-launcher doesn't take into account existing installations, but gives an idea on why the launcher fails to download the current version.

First change this line on /usr/lib/python3/dist-packages/torbrowser_launcher/common.py on line 171, you will need root access to make changes to this file:

if hasattr(self, 'settings') and self.settings['force_en-US']:
    language = 'en-US'
else:
    #language = self.language
    language = "ALL"

Commented out the variable language and set it again with the value "ALL", that way the launcher will look for the correct signatures and tarballs files in the mirror.

Also made a change in line 277 of the same file, this time when setting up the variables to the install location, the launcher will refer to the language setting and set it as part of the directory installation, but the actual package downloaded by the launcher will refer to the directory as tor-browser and not by tor-browser_ALL as the launcher would expect it to do:

"tbb": {
    "changelog": tbb_local \
    + "/tbb/" \
    + self.architecture \
    + "/tor-browser" \
    + "/Browser/TorBrowser/Docs/ChangeLog.txt",
    #+ "/tor-browser_"
    #+ language
    "dir": tbb_local + "/tbb/" + self.architecture,
    "dir_tbb": tbb_local \
    + "/tbb/" \
    + self.architecture \
    + "/tor-browser",
    #+ "/tor-browser_"
    #+ language,
    "start": tbb_local \
    + "/tbb/" \
    + self.architecture \
    + "/tor-browser" \
    + "/start-tor-browser.desktop",
    #+ "/tor-browser_"
    #+ language
},

Here there are three entries that must be changed. All of them refers to /tor-browser_ + language as part of the installation directory. It must be changed to /tor-browser and attention on the second entry as it must end with ,.

This fix is terrible, it doesn't remove the language setting at all, just fixes it in order to make it work with what is available in the mirror. I guess we need to wait for the devs to make this fix on the repo package, by that time those changes will be rewritten and hopefully still works.

Hope this helps.

Muhammad Zubair avatar
in flag
That was fantastic.
Marcel avatar
in flag
It's stupid that this is required
ntk4 avatar
cn flag
Think this just worked for me too. Basically new ubuntu install, few different versions of Python but Python3 was where tor was installed to. One thing, I wonder if adding the Tor browser repo: sudo add-apt-repository ppa:micahflee/ppa and updating/installing using that would have fixed it? As found on linuxize.com tutorial.
Kelvin Bouma avatar
cn flag
nope, still gives a 404 for me
Hippo avatar
cn flag
Thanks for the detailed answer! I see locale/language as a common thread in all these answers, which is cool but...any insight onto why language is causing a problem in the first place? Is it bad case handling when the default language is not en-US or something?
Score:2
ms flag
sudo sed -i 's|self.language =.*|self.language = "ALL"|g' /usr/lib/python3/dist-packages/torbrowser_launcher/common.py
rm -rf ~/{cache,.local/share,.config}/torbrowser
ln -s ~/.local/share/torbrowser/tbb/x86_64/tor-browser ~/.local/share/torbrowser/tbb/x86_64/tor-browser_ALL
torbrowser-launcher

This complete code above should be enough.


Running /home/user/.local/share/torbrowser/tbb/x86_64/tor-browser_ALL/start-tor-browser.desktop

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/torbrowser_launcher/launcher.py", line 442, in success
    self.run_task()
  File "/usr/lib/python3/dist-packages/torbrowser_launcher/launcher.py", line 301, in run_task
    self.run()
  File "/usr/lib/python3/dist-packages/torbrowser_launcher/launcher.py", line 477, in run
    if not self.check_min_version():
  File "/usr/lib/python3/dist-packages/torbrowser_launcher/launcher.py", line 465, in check_min_version
    for line in open(self.common.paths["tbb"]["changelog"], "rb").readlines():
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.local/share/torbrowser/tbb/x86_64/tor-browser_ALL/Browser/TorBrowser/Docs/ChangeLog.txt'
ln -s ~/.local/share/torbrowser/tbb/x86_64{tor-browser,tor-browser_ALL}

and run torbrowser-launcher

Score:1
cn flag

Same thing on Mint 21.5

Removed the following folders:

~/.cache/torbrowser
~/.local/share/torbrowser
~/.config/torbrowser 

As Fellipe Weno said on his post if you have a working Tor Browser installation, you might lose the settings.

With root you must change the common.py file located at /usr/lib/python3/dist-packages/torbrowser_launcher/common.py

if hasattr(self, 'settings') and self.settings['force_en-US']:
    language = 'en-US'
else:
    #language = self.language
    language = "ALL" #ADD THIS LINE

I also modified the tor-browser_ to tor-browser as Fellipe mentions

It worked on linux mint

Regards

Pilot6 avatar
cn flag
Linux Mint is off-topic at this site.
Score:1
as flag
 sudo sed -i 's|self.language =.*|self.language = "ALL"|g' /usr/lib/python3/dist-packages/torbrowser_launcher/common.py

Use this command in terminal to set the self language from common.py

hope it works I have tested it in Ubuntu 22.04.

ps: I found this command from snap comments and worked successfully for me.

Score:1
ps flag

If you get download error 404, run this command:

sudo sed -i 's|self.language =.*|self.language = "ALL"|g' /usr/lib/python3/dist-packages/torbrowser_launcher/common.py

After reopening Tor it will download and work.

David avatar
cn flag
As written this is not answer. Some references would help. How do I know doing this will not mess up my system?
kr flag
I'm confused by the answers: there seem to be different ways of fixing the 404 e.g. ones for Mint which may not work for standard Ubuntu 22.04. What is the definitive method for standard Ubuntu 22.04?
Score:1
pk flag

This is what worked for me:

  1. In /usr/lib/python3/dist-packages/torbrowser_launcher/common.py find and change to the following statements

         ...
         tarball_filename = (
             "tor-browser-linux64-12.0a5_ALL.tar.xz"
         )
        ...
         self.paths["tarball_url"] = (
             "{0}torbrowser/12.0a5/" + tarball_filename
         )
         ...
         self.paths["sig_url"] = (
            "{0}torbrowser/12.0a5/" + tarball_filename + ".asc"
         )
    

Where 12.0a5 is a version I found at https://dist.torproject.org/torbrowser/

  1. Then rename the directory

mv ~/.local/share/torbrowser/tbb/x86_64/tor-browser/ ~/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US

Where _en-Us is my locale, you may have something different.

  1. Finally, launch the torbrowser-launcher
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.