[Bug]: 2.2.1 .deb broken due to incorrect wget invocation #715

Closed
opened 2026-04-24 23:17:58 +02:00 by adam · 1 comment
Owner

Originally created by @deanishe on GitHub (Oct 26, 2022).

Describe the issue

While running dpkg -i audiobookshelf_2.2.1_amd64.deb, the download of tone failed due to an invocation of wget that relies on non-standard configuration.

Specifically, in the preinst script, wget is called without a filename to save to. wget's default behaviour is to use the last path segment of the (final) URL, but the script expects it to use the filename from the Content-Disposition header. This requires the --content-disposition option to be passed to wget.

Better yet, the invocation should explicitly specify the path to save to with --output-document, seeing as the path is hardcoded later in the script, anyway.

Here's the log. As you can see, wget is saving the archive to 9882f966-0df1-4524-ae76-e172da4b9474..., not tone-0.1.1-linux-x64.tar.gz, like the script expects. As a workaround, specifying content_disposition = on in your ~/.wgetrc file allows the download to succeed. (Perhaps the person who wrote the script has this setting?)

Getting tone..
--2022-10-26 09:13:06--  https://github.com/sandreas/tone/releases/download/v0.1.1/tone-0.1.1-linux-x64.tar.gz
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/406651459/9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166acc0bf9ecfc1805aa2c0904fbf3a00e16dd355546f&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=406651459&response-content-disposition=attachment%3B%20filename%3Dtone-0.1.1-linux-x64.tar.gz&response-content-type=application%2Foctet-stream [following]
The name is too long, 467 chars total.
Trying to shorten...
New name is 9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166a.
--2022-10-26 09:13:07--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/406651459/9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166acc0bf9ecfc1805aa2c0904fbf3a00e16dd355546f&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=406651459&response-content-disposition=attachment%3B%20filename%3Dtone-0.1.1-linux-x64.tar.gz&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20113107 (19M) [application/octet-stream]
Saving to: ‘9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166a’

9882f966-0df1-4524-ae76-e172da4b9474? 100%[=======================================================================>]  19.18M  6.05MB/s    in 3.3s    

2022-10-26 09:13:11 (5.89 MB/s) - ‘9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166a’ saved [20113107/20113107]

tar: tone-0.1.1-linux-x64.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

Steps to reproduce the issue

  1. Run dpkg -i audiobookshelf_2.2.1_amd64.deb

Audiobookshelf version

v2.2.1

How are you running audiobookshelf?

Debian/PPA

Originally created by @deanishe on GitHub (Oct 26, 2022). ### Describe the issue While running `dpkg -i audiobookshelf_2.2.1_amd64.deb`, the download of `tone` failed due to an invocation of `wget` that relies on non-standard configuration. Specifically, in [the `preinst` script](https://github.com/advplyr/audiobookshelf/blob/ac46548c4d5e4d438f3da87aa071091bc34100e7/build/debian/DEBIAN/preinst#L52), `wget` is called without a filename to save to. `wget`'s default behaviour is to use the last path segment of the (final) URL, but the script expects it to use the filename from the `Content-Disposition` header. **This requires the `--content-disposition` option to be passed to `wget`**. Better yet, the invocation should explicitly specify the path to save to with `--output-document`, seeing as the path is [hardcoded later in the script](https://github.com/advplyr/audiobookshelf/blob/ac46548c4d5e4d438f3da87aa071091bc34100e7/build/debian/DEBIAN/preinst#L69), anyway. Here's the log. As you can see, `wget` is saving the archive to `9882f966-0df1-4524-ae76-e172da4b9474...`, not `tone-0.1.1-linux-x64.tar.gz`, like the script expects. As a **workaround**, specifying `content_disposition = on` in your `~/.wgetrc` file allows the download to succeed. (Perhaps the person who wrote the script has this setting?) ``` Getting tone.. --2022-10-26 09:13:06-- https://github.com/sandreas/tone/releases/download/v0.1.1/tone-0.1.1-linux-x64.tar.gz Resolving github.com (github.com)... 140.82.121.3 Connecting to github.com (github.com)|140.82.121.3|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/406651459/9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166acc0bf9ecfc1805aa2c0904fbf3a00e16dd355546f&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=406651459&response-content-disposition=attachment%3B%20filename%3Dtone-0.1.1-linux-x64.tar.gz&response-content-type=application%2Foctet-stream [following] The name is too long, 467 chars total. Trying to shorten... New name is 9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166a. --2022-10-26 09:13:07-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/406651459/9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166acc0bf9ecfc1805aa2c0904fbf3a00e16dd355546f&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=406651459&response-content-disposition=attachment%3B%20filename%3Dtone-0.1.1-linux-x64.tar.gz&response-content-type=application%2Foctet-stream Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ... Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 20113107 (19M) [application/octet-stream] Saving to: ‘9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166a’ 9882f966-0df1-4524-ae76-e172da4b9474? 100%[=======================================================================>] 19.18M 6.05MB/s in 3.3s 2022-10-26 09:13:11 (5.89 MB/s) - ‘9882f966-0df1-4524-ae76-e172da4b9474?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T071307Z&X-Amz-Expires=300&X-Amz-Signature=5cd79e7617dc2f2aff2166a’ saved [20113107/20113107] tar: tone-0.1.1-linux-x64.tar.gz: Cannot open: No such file or directory tar: Error is not recoverable: exiting now ``` ### Steps to reproduce the issue 1. Run `dpkg -i audiobookshelf_2.2.1_amd64.deb` ### Audiobookshelf version v2.2.1 ### How are you running audiobookshelf? Debian/PPA
adam added the bug label 2026-04-24 23:17:58 +02:00
adam closed this issue 2026-04-24 23:17:59 +02:00
Author
Owner

@advplyr commented on GitHub (Nov 5, 2022):

Fixed in v2.2.2

@advplyr commented on GitHub (Nov 5, 2022): Fixed in [v2.2.2](https://github.com/advplyr/audiobookshelf/releases/tag/v2.2.2)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#715