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

[Bug]: Flatpak having problem downloading packages via proxy connection. #5239

Open
4 tasks done
GreatBigWhiteWorld opened this issue Jan 2, 2023 · 18 comments
Open
4 tasks done

Comments

@GreatBigWhiteWorld
Copy link

Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.
  • If this is an issue with a particular app, I have tried filing it in the appropriate issue tracker for the app (e.g. under https://github.com/flathub/) and determined that it is an issue with Flatpak itself.
  • This issue is not a report of a security vulnerability (see here if you need to report a security issue).

Flatpak version

1.14.1

What Linux distribution are you using?

openSUSE

Linux distribution version

tumbleweed

What architecture are you using?

x86_64

How to reproduce

  1. Have system proxy enabled in the OS (for opensuse go to Yast-Proxy)
  2. Issue 'flatpak update', get "Error: While pulling app/**** from remote flathub: While fetching https://dl.flathub.org/repo/config: [28] Timeout was reached"
  3. Disable system proxy, relogin and try again, flatpak update works again.

Expected Behavior

Flatpak should work under system proxy, like it has been before (this issue emerged only a few days ago)

Actual Behavior

Flatpak is having trouble downloading packages when system proxy is enabled.

Additional Information

Flatpak can still search packages, meaning it can connect via proxy but not download packages.

The issue is new. It had worked under system proxy without issue in the past.

@mwleeds
Copy link
Collaborator

mwleeds commented Jan 3, 2023

Hi,

Please check that echo $http_proxy prints the correct proxy URI, in a shell where you can reproduce this issue.

@GreatBigWhiteWorld
Copy link
Author

Hi,

Please check that echo $http_proxy prints the correct proxy URI, in a shell where you can reproduce this issue.

Hi, the proxy setting showed the correct values which is the same as the system proxy value. It was set by system proxy not individually for flatpak. This can also be confirmed by that system package manager zypper is working well. Also note that flatpak had been fine prior to one or two weeks ago and I have not changed any proxy settings during this time.

What's a bit suspicious to me is that the last flatpak package update on my OS was in November (to 1.14.1) and I had a few successful 'flatpak update' after that. So it should not be the latest flatpak package causing this issue. Otherwise it'd have happened earlier. But I see that the package "xdg-desktop-portal" was only updated a few weeks ago. I don't know what this package does but could it be the cause?

@Francewhoa
Copy link

Francewhoa commented Jan 22, 2023

We're facing the same challenge in those two other related tickets at:

@Francewhoa
Copy link

We tried to execute echo $http_proxy. But it returns nothing. To resolve this challenge, on Debian 10, we used echo HTTPS_PROXY="$HTTPS_PROXY"

On some other Linux OS, this other alternative command might work echo HTTPS_PROXY=(echo $HTTPS_PROXY)

@Francewhoa
Copy link

Francewhoa commented Jan 22, 2023

This is to confirm that the proxy is configured properly. echo HTTPS_PROXY="$HTTPS_PROXY" return the correct values. Same as GreatBigWhiteWorld's comment #1369392440 above, it is a system-wide proxy. Not individually for Flatpak. All other apps are able to successfully updates through this same proxy. But Flatpak always fails.

Using Debian 10 Backport and Flatpak 1.10.7

@Francewhoa
Copy link

Francewhoa commented Jan 22, 2023

We found a permanent resolution for this challenge. Two steps:

  1. Because we use a proxy, we needed to configure it appropriately. Thanks to mwleeds for his comment #1369346672 above :)

  2. Add the prefix sudo to the Flatpak command. For example:
    This
    sudo flatpak update

    Instead of
    flatpak update


Details and screenshot in my other comment #1399578768

@GreatBigWhiteWorld
Copy link
Author

On another machine which operates opensuse Leap 15.4 and has flatpak 1.12.5 installed, 'flatpak update' still works fine under the same system proxy environment.

@chenyuanrun
Copy link

chenyuanrun commented Apr 22, 2023

I meet this issue in my latest fedora 38 machine:

$  flatpak install flathub com.microsoft.Edge -y -v --ostree-verbose
F: No installations directory in /etc/flatpak/installations.d. Skipping
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/chenyuanrun/.local/share/flatpak
Looking for matches…
F: Fetching summary index file for remote ‘flathub’
F: Loading https://dl.flathub.org/repo/summary.idx using curl
F: Received 10001 bytes
F: Loaded indexed summary file 65ca133af48d144f7febdc5f37a0e667d1b7c88c8b6c1351183015de54e27488 from cache for remote ‘flathub’
F: Transaction: install flathub:app/com.microsoft.Edge/x86_64/stable[*]
F: Looking for remote metadata updates for flathub
F: marking op install:app/com.microsoft.Edge/x86_64/stable resolved to ce1071d553d6f4e07d52076b4b95e0036ad0a7233a556c9a97b763d6231c86d8
F: Updating dependency org.freedesktop.Platform/x86_64/22.08 of com.microsoft.Edge/x86_64/stable
F: Transaction: update flathub:runtime/org.freedesktop.Platform/x86_64/22.08[$old]
F: marking op update:runtime/org.freedesktop.Platform/x86_64/22.08 resolved to 4ba47479a973c9a243112c43f8f58244af34457611e2a26bba8595d08a2b31d7
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/22.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/22.08-extra[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.Locale/x86_64/22.08[/en, /zh]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.openh264/x86_64/2.2.0[*]
F: marking op install/update:runtime/org.freedesktop.Platform.openh264/x86_64/2.2.0 resolved to bf24f23f3ba385f6e8c9215ed94d979db99814b0b614504a23a6d0751dc5f063
F: marking op install/update:runtime/org.freedesktop.Platform.Locale/x86_64/22.08 resolved to 6fcf58c299279dad69858cece7554150040d7824fb766f37958023e1337e7c19
F: marking op install/update:runtime/org.freedesktop.Platform.GL.default/x86_64/22.08-extra resolved to 39d4171ee0ababb7e9568ec43f2097bb5c19be55af47c76f029a8884f066e3fd
F: marking op install/update:runtime/org.freedesktop.Platform.GL.default/x86_64/22.08 resolved to abee275b6a5b094d49a289430687fc7cbcfd7470f49faabe68f4d926bb760f24
F: Checking installation ‘system’ for EOL unused refs
F: Checking installation ‘system’ by checking for dependent refs in ‘user’
F: Checking installation ‘system’ for EOL unused refs
F: Checking installation ‘system’ by checking for dependent refs in ‘user’

com.microsoft.Edge permissions:
    ipc	network	cups	pcsc	pulseaudio	wayland	x11
    devices	file access [1]	dbus access [2]	bus ownership [3]	system dbus access [4]	tags [5]

    [1] /run/.heim_org.h5l.kcm-socket, host-etc, xdg-desktop, xdg-documents, xdg-download, xdg-music, xdg-run/pipewire-0, xdg-videos, ~/.local/share/applications:create,
        ~/.local/share/icons:create
    [2] com.canonical.AppMenu.Registrar, org.freedesktop.FileManager1, org.freedesktop.Notifications, org.freedesktop.ScreenSaver, org.freedesktop.secrets, org.gnome.Mutter.IdleMonitor.*,
        org.gnome.SessionManager, org.kde.kwalletd5
    [3] org.mpris.MediaPlayer2.edge.*
    [4] org.freedesktop.Avahi, org.freedesktop.UPower
    [5] proprietary


 1.	   	com.microsoft.Edge	stable	i	flathub	< 148.2 MB


Installing…
F: Calling system helper: GetRevokefsFd
F: Calling system helper: GetRevokefsFd
F: flatpak_dir_pull: Using commit ce1071d553d6f4e07d52076b4b95e0036ad0a7233a556c9a97b763d6231c86d8 for pull of ref app/com.microsoft.Edge/x86_64/stable from remote flathub
F: Preparing transaction in repository 0x56433c0f1d90
F: Reusing tmpdir staging-33dd63ec-f042-4660-94d0-a86fd085efb1-q1w3ep
F: _ostree_fetcher_should_retry_request: error: 231:0 While fetching https://dl.flathub.org/repo/config: [28] Timeout was reached, n_retries_remaining: 5
Installing…                        0%  0 bytes/s
F: Aborting transaction in repository 0x56433c0f1d90
F: Calling system helper: CancelPull
F: Calling system helper: CancelPull
Error: While pulling app/com.microsoft.Edge/x86_64/stable from remote flathub: While fetching https://dl.flathub.org/repo/config: [28] Timeout was reached
error: Failed to install com.microsoft.Edge: While pulling app/com.microsoft.Edge/x86_64/stable from remote flathub: While fetching https://dl.flathub.org/repo/config: [28] Timeout was reached

I think I have setup a correct http_proxy/https_proxy:

$ echo $http_proxy
http:https://127.0.0.1:8888
$ echo $https_proxy
http:https://127.0.0.1:8888

And I can access the timeout file using curl directly:

$ curl https://dl.flathub.org/repo/config
[core]
repo_version=1
mode=archive-z2
collection-id=org.flathub.Stable
min-free-space-percent=1
enable-uncompressed-cache=false
indexed-deltas=true

[flatpak]
redirect-url=https://dl.flathub.org/repo/
title=Flathub
summary-arches=x86_64;i386

[remote "fdo"]
url=https://cache.sdk.freedesktop.org/releases/

[remote "gnome"]
url=https://gbm.gnome.org/import/repo

@mwleeds Please fix this issue because I rely on proxy a lot to access flathub, thanks!!

@GreatBigWhiteWorld
Copy link
Author

@chenyuanrun Try cleaning the cache folder at $HOME/.cache/flatpak.

@chenyuanrun
Copy link

@chenyuanrun Try cleaning the cache folder at $HOME/.cache/flatpak.

@GreatBigWhiteWorld Thanks, but this doesn't help, still fail to install.

@Francewhoa
Copy link

@chenyuanrun :) Have you tried those 2 steps in this comment above at #5239 (comment)

Or detailed 2 steps with screenshot in my other comment #1399578768

@chenyuanrun
Copy link

@Francewhoa Yes I have tried to add sudo before flatpak, but not work.

@4Aiur
Copy link

4Aiur commented Apr 27, 2023

I have same issue on fedora 38, note that not all flatpaks cannot be downloaded, 3. [\] org.freedesktop.Platform.GL.default can be downloaded at 16.0 kB/s.

My guess is that after Fedora 37 is updated to 38, the proxy setting no longer works, and I can connect at a very slow speed when checking for updates, and downloading updates is completely unavailable.

maxwell@fedora ~ [1]> echo $http_proxy
http:https://127.0.0.1:7890

maxwell@fedora ~> sudo flatpak update
[sudo] password for maxwell: 
Looking for updates…


        ID                                          Branch             Op        Remote         Download
 1. [✗] com.bitwarden.desktop.Locale                stable             u         flathub            1.0 kB / 7.2 MB
 2. [✗] org.chromium.Chromium.Codecs                stable             u         flathub            1.0 kB / 1.1 MB
 3. [\] org.freedesktop.Platform.GL.default         22.08              u         flathub            4.1 MB / 142.3 MB
 4. [ ] org.freedesktop.Platform.GL.default         22.08-extra        u         flathub        < 142.3 MB
 5. [ ] org.freedesktop.Platform.Locale             22.08              u         flathub        < 333.3 MB (partial)
 6. [ ] org.freedesktop.Platform.VAAPI.Intel        22.08              u         flathub         < 13.4 MB
 7. [ ] org.freedesktop.Platform                    22.08              u         flathub        < 214.3 MB
 8. [ ] org.chromium.Chromium                       stable             u         flathub        < 130.6 MB
 9. [ ] com.google.Chrome                           stable             u         flathub        < 100.7 MB
10. [ ] com.bitwarden.desktop                       stable             u         flathub        < 122.5 MB
11. [ ] org.freedesktop.Sdk.Locale                  22.08              u         flathub        < 339.1 MB (partial)
12. [ ] org.freedesktop.Sdk                         22.08              u         flathub        < 513.2 MB
13. [ ] com.visualstudio.code                       stable             u         flathub         < 92.4 MB
14. [ ] org.kde.PlatformTheme.QGnomePlatform        5.15-22.08         u         flathub         < 10.6 MB

Warning: While pulling runtime/com.bitwarden.desktop.Locale/x86_64/stable from remote flathub: While fetching https://dl.flathub.org/repo/objects/1d/85c900f53c3edcff3c2229a2ea42418228a8efe6dd7b54a74f991d7b6841a2.commitmeta: [28] Timeout was reached
Warning: While pulling runtime/org.chromium.Chromium.Codecs/x86_64/stable from remote flathub: While fetching https://dl.flathub.org/repo/config: [28] Timeout was reached
Updating 3/14… ████████████████████ 100%  16.0 kB/s  00:00⏎                                                           maxwell@fedora ~ [1]> sudo flatpak remote-add --authenticator-install flathub https://flathub.org/repo/flathub.flatpakrepo
[sudo] password for maxwell: 
error: Can't load uri https://flathub.org/repo/flathub.flatpakrepo: While fetching https://flathub.org/repo/flathub.flatpakrepo: [16] Error in the HTTP2 framing layer

maxwell@fedora ~ [1]> curl  https://flathub.org/repo/flathub.flatpakrepo
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.24.0</center>
</body>
</html>
maxwell@fedora ~> 

@pheeef
Copy link

pheeef commented Apr 27, 2023

I'm experiencing the same problem with my Fedora 38 install. It worked fine with Fedora 37, but since the update I'm getting the While fetching https://dl.flathub.org/repo/config: [28] Timeout was reached error.

  • http(s)_proxy variables are set
  • I can reach it fine with curl

@mbainter
Copy link

mbainter commented May 2, 2023

I'm experiencing the same problem with latest PopOS (22.04-ish) -- but my situation is slightly different.

I have my proxy defined only in gsettings/dconf, and it is an "autoconfigured" proxy from a URL that only proxies connections for a specific (internal) domain. In this situation, there is no $http_proxy or $https_proxy set, but it should be using the direct internet connection anyway.

Everything else seems to work fine with this, but for some reason flatpak, which should not even be trying to use the proxy, fails unless I disable the proxy.

@Francewhoa
Copy link

Hello @4Aiur, @chenyuanrun, @GreatBigWhiteWorld, @mbainter, @pheeef, and all Flatpak enthusiasts :)

For developers interested to contribute to resolving this challenge, one likely cause of this challenge is maybe the https_proxy environment variable. Which seems to be case-sensitive. Depending on the environment, it is either UPPERCASE or lowercase. If so, to resolve this challenge, maybe the Flatpak's code needs to be adapted accordingly. Details in comment #2540 (comment) by @mpilawa

For users interested to contribute and speed up the resolution of this challenge, when you add a comment about flagging a challenge, if not already done, I suggest to always include which operating system you're using and which version (environment). For example, Debian 10 Buster. In turn, developers are able to test with the appropriate environment.

@mbainter
Copy link

mbainter commented May 11, 2023

@Francewhoa - if you look at my report I have no proxy environment variable at all, because flatpak shouldn't be using a proxy, but rather connecting directly. I assume it is pulling the proxy configuration from dconf somehow - but that proxy configuration only applies to one domain and everything else goes direct so it still shouldn't matter.

I have no other applications that have this behavior. And seeing an environment variable is unlikely to help as that variable would need to say, "don't use a proxy" which isn't the purpose of http_proxy.

@4Aiur
Copy link

4Aiur commented May 11, 2023

@mbainter

I noticed the statistics on the number of App installations on Flathub, almost all Apps were installed on the dates of 04/08 05/04 05/07 The number has dropped sharply, such as Chrome, Firefox, I think there may be a problem with Flathub that makes it impossible to download.

And I didn't update flatpak, but after a few days I was able to download it again, this coincides with the rebound in the curve data in the install statistics chart below.

Screenshot from 2023-05-11 10-25-52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants