[Support] Audiobookshelf


Recommended Posts

On 10/5/2022 at 1:07 AM, jxjelly said:

 

I don't think this is the correct way to do this. Not sure what problems you were having with the standard config. This worked for me, just make sure you're on the same network as SWAG

 

## Version 2021/05/18

# make sure that your dns has a cname set for <container_name> and that your <container_name> container is not using a base url

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name audiobookshelf.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    # enable for Authelia
    #include /config/nginx/authelia-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /ldaplogin;

        # enable for Authelia
        #include /config/nginx/authelia-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app audiobookshelf;
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

}

 

 

I'm struggling to get this to work, and quite possibly I'm misunderstanding what I'm meant to be doing. I'm using Swag, and Audiobookshelf is on the same network, and I have subdomains set up. (Swag currently works fine for Nextcloud and Calibre-web.) My objective is to be able to reach Audiobookshelf when I'm away from my home network.

 

I see that the above config file is pretty much the same as the sample audiobookshelf.subdomain.conf file that comes with Swag, so this looks like it should be quite sound.

 

My question is about

# make sure that your dns has a cname set for <container_name> and that your <container_name> container is not using a base url

How would I go about doing this? My container name is Audiobookshelf, and I've got a file named audiobookshelf.subdomain.conf with the lines as set out by @jxjelly above. The only difference is that my subdomain is in the form abcaudiobookshelf.domain.org, so I've set the server_name line to

    server_name abcaudiobookshelf.*;

 

I'm not sure whether the problem actually lies with the way I try to connect to Audiobookshelf from Android. On my home network over wi-fi I just use the internal IP address and port 13378 and it connects fine. But when I try from outside my home network, I've tried using abcaudiobookshelf.domain.org (without a port), as well as abcaudiobookshelf.domain.org:13378, I get a message in the app saying "Failed to ping server". I also can't reach Audiobookshelf from my Win10 browser when I try abcaudiobookshelf.domain.org with and without the port.

 

In my container template, I've set the Network Type to "Custom: someproxynet" where someproxynet is the proxy network used by my other reverse proxy containers. Also, my Web UI Port is set to 13378 for the container port 80.

 

Any help would be appreciated.

Link to comment
2 minutes ago, sonofdbn said:

 

I'm struggling to get this to work, and quite possibly I'm misunderstanding what I'm meant to be doing. I'm using Swag, and Audiobookshelf is on the same network, and I have subdomains set up. (Swag currently works fine for Nextcloud and Calibre-web.) My objective is to be able to reach Audiobookshelf when I'm away from my home network.

 

I see that the above config file is pretty much the same as the sample audiobookshelf.subdomain.conf file that comes with Swag, so this looks like it should be quite sound.

 

My question is about

# make sure that your dns has a cname set for <container_name> and that your <container_name> container is not using a base url

How would I go about doing this? My container name is Audiobookshelf, and I've got a file named audiobookshelf.subdomain.conf with the lines as set out by @jxjelly above. The only difference is that my subdomain is in the form abcaudiobookshelf.domain.org, so I've set the server_name line to

    server_name abcaudiobookshelf.*;

 

I'm not sure whether the problem actually lies with the way I try to connect to Audiobookshelf from Android. On my home network over wi-fi I just use the internal IP address and port 13378 and it connects fine. But when I try from outside my home network, I've tried using abcaudiobookshelf.domain.org (without a port), as well as abcaudiobookshelf.domain.org:13378, I get a message in the app saying "Failed to ping server". I also can't reach Audiobookshelf from my Win10 browser when I try abcaudiobookshelf.domain.org with and without the port.

 

In my container template, I've set the Network Type to "Custom: someproxynet" where someproxynet is the proxy network used by my other reverse proxy containers. Also, my Web UI Port is set to 13378 for the container port 80.

 

Any help would be appreciated.

 

Are you making sure to put the "https://" part of the server address?
If you join the Discord/Matrix server there are also many more users on there with various setups that are helping others.

Link to comment

Thanks for the quick response. Indeed using "https://" and my abcaudiobookshelf.domain.org address (no port) got me in. But while I can see the library, I can't listen - the cloud icon is orange and connection status is "Socket not connected".

 

(Just documenting this for anyone reading the thread. I'll go onto Discord and look around.)

Link to comment

Just, I hope, to close this: got everything working by fixing my Swag configuration. My problem was that I hadn't updated the proxy.conf file to the latest updated one. I was still using a version from 2019. Once I updated, I connected with no problem and could hear the audio.

 

TL;DR If you're using Swag for reverse proxy, use the default config file for audiobookshelf and make the very minor change to server_name for your sub-domain. Also make sure your proxy.conf is up-to-date. (Easily checked by looking at the Swag logs.)

  • Like 2
Link to comment
  • 3 weeks later...

I probably did something dumb here but I had to reinstall ABS from scratch and I can't get sockets working with default swag reverse proxy. 

 

2023-03-08 22:00:47

ERROR

Api called without a token /authorize

2023-03-08 22:00:50

ERROR

Api called without a token /libraries

2023-03-08 22:00:50

ERROR

Api called without a token /tasks

 

I did the suggestion earlier in the thread with the same results. It works fine by IP address. I have a custom IP I use (macvlan) and this was working ~a month ago or so.  Any help would be great!

Link to comment
  • 1 month later...

I've just installed Audiobookshelf and set it up with its own static IP address on my network, and I can access it both internally and externally (via DNS hostname) through a web browser. While the Android app connects fine if I add the LAN IP, it won't connect via my external hostname. All it says is 'Failed to ping server' when I try to add it. I've tried both over WiFi connected to the same network, and over my data connection. Could it be because I'm accessing this through a reverse proxy (HAProxy) and trying to connect via HTTPS, or is there something else I should check?

 

EDIT: Rebooting my phone seemed to fix it. Weird...

Edited by jonitfcfan
  • Like 1
Link to comment
  • 2 weeks later...
  • 3 weeks later...
On 10/3/2022 at 1:09 PM, DeadChimi said:

I decided to set my Media share public, and it fixed the issue when connecting via the guest account so It was an issue on my end.  I guess I need to figure out why permissions aren't being handed down recursively to new files that are created in the share.  At least it wasn't something on your end.

I am having a similar issue, but setting the share to public didn't do anything (it has always been public).  Any podcast I download using ABS makes it so I don't have permission to edit, delete, or move it when I navigate to it using file explorer or even Krusader.  If I run the Docker Safe New Perms it fixes it.  But am I doing something wrong from the get go with my config settings or something?  I don't have this issue with any of the arr or other dl dockers I use.  (also my knowledge of permission and stuff is pretty dang shallow)

Link to comment
  • 1 month later...
  • 4 weeks later...

Anybody having js errors preventing the container from starting? Started with the latest update...


Logs:

<--- Last few GCs --->

[1:0x1478552a43f0]     9465 ms: Scavenge 4046.9 (4113.7) -> 4046.6 (4124.5) MB, 6.1 / 0.0 ms  (average mu = 0.857, current mu = 0.648) allocation failure 
[1:0x1478552a43f0]     9505 ms: Scavenge 4053.6 (4124.5) -> 4053.9 (4124.7) MB, 7.0 / 0.0 ms  (average mu = 0.857, current mu = 0.648) allocation failure 
[1:0x1478552a43f0]     9518 ms: Scavenge 4054.4 (4124.7) -> 4053.5 (4147.2) MB, 11.2 / 0.0 ms  (average mu = 0.857, current mu = 0.648) allocation failure 


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Config /config /metadata
[2023-07-16 15:01:58] INFO: === Starting Server ===
[2023-07-16 15:01:58] INFO: [Server] Init v2.3.0
[2023-07-16 15:01:58] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2023-07-16 15:01:58] INFO: [Database] Db connection was successful
[2023-07-16 15:01:59] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting

 

Link to comment
1 hour ago, 9BAR said:

Anybody having js errors preventing the container from starting? Started with the latest update...


Logs:

<--- Last few GCs --->

[1:0x1478552a43f0]     9465 ms: Scavenge 4046.9 (4113.7) -> 4046.6 (4124.5) MB, 6.1 / 0.0 ms  (average mu = 0.857, current mu = 0.648) allocation failure 
[1:0x1478552a43f0]     9505 ms: Scavenge 4053.6 (4124.5) -> 4053.9 (4124.7) MB, 7.0 / 0.0 ms  (average mu = 0.857, current mu = 0.648) allocation failure 
[1:0x1478552a43f0]     9518 ms: Scavenge 4054.4 (4124.7) -> 4053.5 (4147.2) MB, 11.2 / 0.0 ms  (average mu = 0.857, current mu = 0.648) allocation failure 


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Config /config /metadata
[2023-07-16 15:01:58] INFO: === Starting Server ===
[2023-07-16 15:01:58] INFO: [Server] Init v2.3.0
[2023-07-16 15:01:58] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2023-07-16 15:01:58] INFO: [Database] Db connection was successful
[2023-07-16 15:01:59] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting

 


I'm pushing a patch soon that fixes a few bugs with the previous release. Make sure to check the release notes because you will need to manually delete the `/config/absdatabase.sqlite` before upgrading so the migration can run again.

  • Like 1
Link to comment
10 minutes ago, advplyr said:


I'm pushing a patch soon that fixes a few bugs with the previous release. Make sure to check the release notes because you will need to manually delete the `/config/absdatabase.sqlite` before upgrading so the migration can run again.

 

Stellar. Thanks, advplyr!

Link to comment

I successfully updated and remigrated, but the JavaScript heap error kept the container from starting. I was able to work around the issue by adding a variable to the template with the following information:

Config Type: Variable
Name: NODE_OPTIONS
Key: NODE_OPTIONS
Value: --max-old-space-size=8192
Default Value: --max-old-space-size=8192
Description: node.js memory allocation

 

This provides js with a little extra memory. I'm not sure if it's a great solution, but this works for now.

 

Edit: Protip -- I solved additional problems with the application by performing a re-scan of all my libraries once I got the container up and running. It's lookin' as though she's stabilized, now. Fingers crossed.

Edited by 9BAR
Link to comment
4 hours ago, 9BAR said:

Well, while my aforementioned fix does allow the container to start and then run for about 20 minutes, the application continues to crash. Looking things over, it looks as though it's now attempting to write duplicate keys to the database:
 

  Hide contents

            manuallyVerified: false,
            invalid: false,
            exclude: false,
            error: null,
            format: 'MP2/3 (MPEG audio layer 2/3)',
            duration: 1604.466939,
            bitRate: 128000,
            language: null,
            codec: 'mp3',
            timeBase: '1/14112000',
            channels: 2,
            channelLayout: 'stereo',
            chapters: [],
            embeddedCoverArt: 'mjpeg',
            metaTags: [Object],
            mimeType: 'audio/mpeg'
          },
          chapters: [],
          extraData: {},
          updatedAt: 2023-07-17T14:02:08.007Z,
          createdAt: 2023-07-17T14:02:08.007Z
        },
        _previousDataValues: {
          id: undefined,
          index: undefined,
          season: undefined,
          episode: undefined,
          episodeType: undefined,
          title: undefined,
          subtitle: undefined,
          description: undefined,
          pubDate: undefined,
          enclosureURL: undefined,
          enclosureSize: undefined,
          enclosureType: undefined,
          publishedAt: undefined,
          podcastId: undefined,
          audioFile: undefined,
          chapters: undefined,
          extraData: undefined
        },
        uniqno: 1,
        _changed: Set(17) {
          'id',
          'index',
          'season',
          'episode',
          'episodeType',
          'title',
          'subtitle',
          'description',
          'pubDate',
          'enclosureURL',
          'enclosureSize',
          'enclosureType',
          'publishedAt',
          'podcastId',
          'audioFile',
          'chapters',
          'extraData'
        },
        _options: {
          isNewRecord: true,
          _schema: null,
          _schemaDelimiter: '',
          attributes: undefined,
          include: undefined,
          raw: undefined,
          silent: undefined
        },
        isNewRecord: true
      },
      validatorKey: 'not_unique',
      validatorName: null,
      validatorArgs: []
    }
  ],
  parent: [Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: podcastEpisodes.id] {
    errno: 19,
    code: 'SQLITE_CONSTRAINT',
    sql: 'INSERT INTO `podcastEpisodes` (`id`,`index`,`season`,`episode`,`episodeType`,`title`,`subtitle`,`description`,`pubDate`,`enclosureURL`,`enclosureSize`,`enclosureType`,`publishedAt`,`audioFile`,`chapters`,`extraData`,`createdAt`,`updatedAt`,`podcastId`) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19);'
  },
  original: [Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: podcastEpisodes.id] {
    errno: 19,
    code: 'SQLITE_CONSTRAINT',
    sql: 'INSERT INTO `podcastEpisodes` (`id`,`index`,`season`,`episode`,`episodeType`,`title`,`subtitle`,`description`,`pubDate`,`enclosureURL`,`enclosureSize`,`enclosureType`,`publishedAt`,`audioFile`,`chapters`,`extraData`,`createdAt`,`updatedAt`,`podcastId`) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19);'
  },
  fields: [ 'id' ],
  sql: 'INSERT INTO `podcastEpisodes` (`id`,`index`,`season`,`episode`,`episodeType`,`title`,`subtitle`,`description`,`pubDate`,`enclosureURL`,`enclosureSize`,`enclosureType`,`publishedAt`,`audioFile`,`chapters`,`extraData`,`createdAt`,`updatedAt`,`podcastId`) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19);'
}

 

This was after a successful migration. I'm guessing this occurs when a scheduled download/check occurs.

 

I'm trying to reproduce this issue but unable. Are you able to reproduce this? If so, can you give me steps to reproduce?

Link to comment
13 hours ago, advplyr said:

 

I'm trying to reproduce this issue but unable. Are you able to reproduce this? If so, can you give me steps to reproduce?

 

Thankfully, I managed to resolve my database error by re-scanning my libraries. I can no longer reproduce.

 

After updating the container, I ran into this issue again; the container would crash a few minutes after starting with the same "SQLITE_CONSTRAINT: UNIQUE" error. I'm not sure what's causing this so I'm not sure how to provide steps to reproduce it.

 

This is probably a one-off; some rogue podcast gumming up the works.

I created a backup file (awesome feature by the way). I removed and deleted the container, image, and appdata folder. Then I re-added the container using my template, let it rebuild the appdata folder, and restored from my backup. It seems to be holding steady -- but I'll report any changes.

Edited by 9BAR
  • Like 1
Link to comment

Just jumping in to say im having the same issue, the docker seems to be staying alive until it tries to download something as the last log is always something like:

 

[2023-07-25 12:00:06] INFO: [PodcastManager] Found 1 new episodes for podcast "Stuff You Missed in History Class" - starting download

 

Held off trying the above fixes for now incase there are any further updates due in...

Link to comment

I am getting the same error, if I manually get the podcasts to download everything this is fine. One or more of them is causing the docker to crash when the cron job runs. I think it is one badly behaved podcast that requires authentication, I have now turned of automatic updates off that so I will see if the container remains up.

Link to comment

Changing root password?

 

My firefox install went bad due to snap being weird and the only password I have managed to loose was the root account for audiobookshelf. I googled how to change had the suggestion was to alter a dataX.json file, but i can't find a file that looks like that in my install? Has the method to alter the root password changed?

 

Thanks.

Link to comment
6 hours ago, PRG said:

Changing root password?

 

My firefox install went bad due to snap being weird and the only password I have managed to loose was the root account for audiobookshelf. I googled how to change had the suggestion was to alter a dataX.json file, but i can't find a file that looks like that in my install? Has the method to alter the root password changed?

 

Thanks.

Hey the database changed to sqlite. At the moment you will have to open the database and go to the "users" table and remove the password hash in the column "pash". I'm not sure how familiar you are with databases but the easiest way is probably to get a software that gives you a GUI. There are many ways

Link to comment
  • 2 weeks later...
On 7/25/2023 at 5:42 PM, Eyean said:

Just jumping in to say im having the same issue, the docker seems to be staying alive until it tries to download something as the last log is always something like:

 

[2023-07-25 12:00:06] INFO: [PodcastManager] Found 1 new episodes for podcast "Stuff You Missed in History Class" - starting download

 

Held off trying the above fixes for now incase there are any further updates due in...

So think ive fixed my issue. 

 

Seemed to crash when ever i did a scan of the Podcasts, I managed to whittle it down to a single podcast that was causing the issue (Stuff you Missed in History Class) - my assumption is that it may have something to do with the fact there were over 2k downloaded episodes in there... 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.