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

App updates broken when running NextCloud on OpenWrt #24136

Closed
flyn-org opened this issue Nov 14, 2020 · 5 comments
Closed

App updates broken when running NextCloud on OpenWrt #24136

flyn-org opened this issue Nov 14, 2020 · 5 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@flyn-org
Copy link

I run NextCloud 19.0.4 on OpenWrt. OpenWrt's libcurl does not have support for compression, and I suspect this is getting in the way of NextCloud updating its apps. Here are the libraries OpenWrt's libcurl depends on:

# ldd /usr/lib/libcurl.so.4
	ldd (0x7fdb98182000)
	libwolfssl.so.24 => /usr/lib/libwolfssl.so.24 (0x7fdb97fd0000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7fdb97fbc000)
	libc.so => ldd (0x7fdb98182000)

Loading https://www.flyn.org/share/index.php/settings/apps does not present me with an option to update out-of-date apps. Rather, I see this in the logs:

{"reqId":"[ID]","level":2,"time":"2020-11-14T17:12:03+00:00","remoteAddr":"[IP]","user":"[USER]","app":"appstoreFetcher","method":"GET","url":"/share/index.php/settings/apps/list","message":{"Exception":"GuzzleHttp\\Exception\\RequestException","Message":"cURL error 61: Unrecognized content encoding type. libcurl understands identity content encodings. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)", ... "args":["get","https://apps.nextcloud.com/api/v1/apps.json" ...
@flyn-org flyn-org added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 14, 2020
@flyn-org
Copy link
Author

flyn-org commented Dec 2, 2020

I confirmed that compiling libcurl on OpenWrt with libz support works around this bug. Is the HTTP compression scheme negotiation in NextCloud, Guzzle, or the app server broken?

@LorbusChris
Copy link
Contributor

LorbusChris commented Jan 31, 2021

It looks like this is the culprit: https://github.com/nextcloud/server/blob/master/lib/private/Http/Client/Client.php#L95 - the only understood encoding type is identity for curl on OpenWrt, but the linked line will make it so that it requests gzip-encoded responses anyway.

Maybe there's a way to override this default accept-encoded header setting, changing it from gzip to identity.

An even better solution would be to build curl on openwrt with support for compression...

@LorbusChris
Copy link
Contributor

I can confirm that changing it from gzip to identity fixed the issue..

xref: https://gitlab.nic.cz/turris/turris-os-packages/-/issues/662

@LorbusChris
Copy link
Contributor

Hi @MorrisJobke, I'm tagging you since you made the change: https://github.com/nextcloud/server/blame/86678ba5df7b74fab9ac739ca17109cd717f8062/lib/private/Http/Client/Client.php#L95 .

tl;dr on OpenWRT curl doesn't support compression, and thus what we need here is a way to configure an override for that hardcoded gzip default Accept-Encoding header, replacing it with identity.

@MorrisJobke
Copy link
Member

@LorbusChris @flyn-org Thanks for the report and the deep dive into the issue. Unfortunately I need to say that adding more config options also adds to the complexity of Nextcloud.

Also running Nextcloud on OpenWRT seems to be a pretty rare setup. Thus I would recommend you to just patch out the line in your installation.

Sorry for the inconvenience here, but we have to also use our limited resources that they are useful for as many people as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

3 participants