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]: Uncaught Exception stops server, and cannot be restarted without quitting tray and restarting. #2998

Open
coreyemmons opened this issue May 22, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@coreyemmons
Copy link

What happened?

Periodically, my server will stop and cannot be started again unless the tray application is exited and restarted. I checked the corresponding AudioBookShelf log, and there were no entries for the time specified, as well as three minutes before the incident.

What did you expect to happen?

Basically, I expected the system to not crash when it was idle. I don't know why it was looking for a file in the APPDATA\Temp directory.

Steps to reproduce the issue

  1. Unknown, as the server was idle at the time. I was browsing the internet on the machine, and it is also a Plex server, but as far as I know they should not conflict with one another.

Audiobookshelf version

2.9.0

How are you running audiobookshelf?

Windows Tray App

What OS is your Audiobookshelf server hosted from?

Windows

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

[Server] [2024-05-22 19:03:28.087] FATAL: [Server] Uncaught exception origin: uncaughtException, error: Error: ENOENT: no such file or directory, open 'C:\Users\<USER>\AppData\Local\Temp\pkg-wT8cRv\d37ed123d39404b70c20b9422e2946b3f9542e810059da08d495a9d67efed39b'
[Server]     at Object.openSync (node:fs:599:3)
[Server]     at Object.openSync (pkg/prelude/bootstrap.js:793:32)
[Server]     at uncompressExternallyAndOpen (pkg/prelude/bootstrap.js:748:19)
[Server]     at pkg/prelude/bootstrap.js:763:32
[Server]     at FSReqCallback.oncomplete (node:fs:201:23) {
[Server]   errno: -4058,
[Server]   syscall: 'open',
[Server]   code: 'ENOENT',
[Server]   path: 'C:\\Users\\<USER>\\AppData\\Local\\Temp\\pkg-wT8cRv\\d37ed123d39404b70c20b9422e2946b3f9542e810059da08d495a9d67efed39b'
[Server] } (    at process.<anonymous> (C:\snapshot\audiobookshelf\server\Server.js))
[Server] node:internal/fs/utils:347
[Server]     throw err;
[Server]     ^
[Server] Error: ENOENT: no such file or directory, open 'C:\Users\<USER>\AppData\Local\Temp\pkg-wT8cRv\d37ed123d39404b70c20b9422e2946b3f9542e810059da08d495a9d67efed39b'
[Server]     at Object.openSync (node:fs:599:3)
[Server]     at Object.openSync (pkg/prelude/bootstrap.js:793:32)
[Server]     at uncompressExternallyAndOpen (pkg/prelude/bootstrap.js:748:19)
[Server]     at pkg/prelude/bootstrap.js:763:32
[Server]     at FSReqCallback.oncomplete (node:fs:201:23) {
[Server]   errno: -4058,
[Server]   syscall: 'open',
[Server]   code: 'ENOENT',
[Server]   path: 'C:\\Users\\<USER>\\AppData\\Local\\Temp\\pkg-wT8cRv\\d37ed123d39404b70c20b9422e2946b3f9542e810059da08d495a9d67efed39b'
[Server] }
[Server] Node.js v18.5.0
[App   ] [2024-05-22 19:03:28.280] DEBUG: [AppTray] sender exit code: 1
[App   ] [2024-05-22 19:03:28.280] ERROR: [AppTray] Server exited with error code 1
[App   ] [2024-05-22 19:03:43.850] DEBUG: [AppTray] About to exit...
[App   ] [2024-05-22 19:03:43.850] DEBUG: [AppTray] Stopping server...
[App   ] [2024-05-22 19:03:43.850] DEBUG: [AppTray] Server stopped

Additional Notes

No response

@coreyemmons coreyemmons added the bug Something isn't working label May 22, 2024
@advplyr
Copy link
Owner

advplyr commented May 23, 2024

This probably belongs in https://github.com/mikiher/audiobookshelf-windows, I don't recognize that folder path.

@mikiher any thoughts on this one?

@mikiher
Copy link
Contributor

mikiher commented May 23, 2024

I have not encountered a crash like this.
It seems weird that this happens randomly while the server is idle. Can you please share the full log file?
It is usually located at %LOCALAPPDATA%\AudiobookshelfTray\logfile.txt

@coreyemmons
Copy link
Author

coreyemmons commented May 24, 2024 via email

@advplyr advplyr added waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels May 25, 2024
@coreyemmons
Copy link
Author

Logfile attached
logfile.txt

@mikiher
Copy link
Contributor

mikiher commented May 28, 2024

OK, it looks like you have a periodic podcast check running every hour, but it didn't seem to have been running while the crash happened (the last check ended 3 minutes before the crash), so it doesn't seem likely that it's connected to it.

This crash happened internally in the pkg code (pkg is the component that bundles Node and the server into a windows executable and is responsible for loading and running it), and unfortunately it is hard to understand from the exception what happened, except that it was trying to access its temp directory and it didn't exist.

You said this happens periodically, however I only found one uncaught exception in the log.
Did the server have additional crashes during the period covered by the log? How often does this happen?

@coreyemmons
Copy link
Author

coreyemmons commented May 28, 2024 via email

@advplyr
Copy link
Owner

advplyr commented Jun 11, 2024

Any update on this?

@coreyemmons
Copy link
Author

Thanks for the reminder. I just looked through the logs, and have found the following other instances:

[Server] [2024-05-09 15:52:32.647] INFO: [SocketAuthority] Socket g8zW0E8csf057Wk6AAAB disconnected from client "root" after 1234355160ms (Reason: transport close) [Server] [2024-05-09 15:52:59.765] FATAL: [Server] Uncaught exception origin: uncaughtException, error: Error: ENOENT: no such file or directory, open 'C:\Users\corey\AppData\Local\Temp\pkg-pbjgDk\63c2d1967c26bcce8507095dbed019eabe56ca034b6fb684c1c8539f8268e007' [Server] at Object.openSync (node:fs:599:3) [Server] at Object.openSync (pkg/prelude/bootstrap.js:793:32) [Server] at uncompressExternallyAndOpen (pkg/prelude/bootstrap.js:748:19) [Server] at pkg/prelude/bootstrap.js:763:32 [Server] at FSReqCallback.oncomplete (node:fs:201:23) { [Server] errno: -4058, [Server] syscall: 'open', [Server] code: 'ENOENT', [Server] path: 'C:\\Users\\corey\\AppData\\Local\\Temp\\pkg-pbjgDk\\63c2d1967c26bcce8507095dbed019eabe56ca034b6fb684c1c8539f8268e007' [Server] } ( at process.<anonymous> (C:\snapshot\audiobookshelf\server\Server.js)) [Server] node:internal/fs/utils:347 [Server] throw err; [Server] ^ [Server] Error: ENOENT: no such file or directory, open 'C:\Users\corey\AppData\Local\Temp\pkg-pbjgDk\63c2d1967c26bcce8507095dbed019eabe56ca034b6fb684c1c8539f8268e007' [Server] at Object.openSync (node:fs:599:3) [Server] at Object.openSync (pkg/prelude/bootstrap.js:793:32) [Server] at uncompressExternallyAndOpen (pkg/prelude/bootstrap.js:748:19) [Server] at pkg/prelude/bootstrap.js:763:32 [Server] at FSReqCallback.oncomplete (node:fs:201:23) { [Server] errno: -4058, [Server] syscall: 'open', [Server] code: 'ENOENT', [Server] path: 'C:\\Users\\corey\\AppData\\Local\\Temp\\pkg-pbjgDk\\63c2d1967c26bcce8507095dbed019eabe56ca034b6fb684c1c8539f8268e007' [Server] }
[Server] [2024-04-21 16:13:31.703] FATAL: [Server] Uncaught exception origin: uncaughtException, error: Error: ENOENT: no such file or directory, open 'C:\Users\corey\AppData\Local\Temp\pkg-5rf78R\83edb02c6645e04d0ee9dfa46286f532453fe17d206b1f4a05f8c59b6220c86e' [Server] at Object.openSync (node:fs:599:3) [Server] at Object.openSync (pkg/prelude/bootstrap.js:793:32) [Server] at uncompressExternallyAndOpen (pkg/prelude/bootstrap.js:748:19) [Server] at pkg/prelude/bootstrap.js:763:32 [Server] at FSReqCallback.oncomplete (node:fs:201:23) { [Server] errno: -4058, [Server] syscall: 'open', [Server] code: 'ENOENT', [Server] path: 'C:\\Users\\corey\\AppData\\Local\\Temp\\pkg-5rf78R\\83edb02c6645e04d0ee9dfa46286f532453fe17d206b1f4a05f8c59b6220c86e' [Server] } ( at process.<anonymous> (C:\snapshot\audiobookshelf\server\Server.js)) [Server] node:internal/fs/utils:347 [Server] throw err; [Server] ^ [Server] Error: ENOENT: no such file or directory, open 'C:\Users\corey\AppData\Local\Temp\pkg-5rf78R\83edb02c6645e04d0ee9dfa46286f532453fe17d206b1f4a05f8c59b6220c86e' [Server] at Object.openSync (node:fs:599:3) [Server] at Object.openSync (pkg/prelude/bootstrap.js:793:32) [Server] at uncompressExternallyAndOpen (pkg/prelude/bootstrap.js:748:19) [Server] at pkg/prelude/bootstrap.js:763:32 [Server] at FSReqCallback.oncomplete (node:fs:201:23) { [Server] errno: -4058, [Server] syscall: 'open', [Server] code: 'ENOENT', [Server] path: 'C:\\Users\\corey\\AppData\\Local\\Temp\\pkg-5rf78R\\83edb02c6645e04d0ee9dfa46286f532453fe17d206b1f4a05f8c59b6220c86e' [Server] }

Please let me know if you need anything else. It has not happened again at this point.

@faush01
Copy link
Contributor

faush01 commented Aug 6, 2024

I have also seen this a few times, here is the latest one, it happened when I stopped a playback in the web player.

[2024-08-06 08:12:00.391] DEBUG: [ApiCacheManager] Cache miss: {"user":"admin","url":"/libraries/db85f0af-0afc-4887-a3f2-d235ee9e633e/items?sort=media.metadata.publishedYear&desc=0&limit=100&page=1&minified=1&include=rssfeed,numEpisodesIncomplete"} (    at ServerResponse.send (C:\snapshot\audiobookshelf\server\managers\ApiCacheManager.js))
[2024-08-06 08:13:38.246] DEBUG: [ApiCacheManager] Object.afterBulkUpdate: Clearing cache (    at ApiCacheManager.clear (C:\snapshot\audiobookshelf\server\managers\ApiCacheManager.js))
[2024-08-06 08:13:38.247] DEBUG: [PlaybackSessionManager] startSessionRequest for device Windows 10 / Firefox (    at PlaybackSessionManager.startSessionRequest (C:\snapshot\audiobookshelf\server\managers\PlaybackSessionManager.js))
[2024-08-06 08:13:38.247] DEBUG: [PlaybackSessionManager] "admin" starting direct play session for item "7d49d59a-9e68-4803-8e60-52f91cfa61b5" with id 9a2d5fe6-da94-45c0-8981-327759f00f72 (Device: Windows 10 / Firefox) (    at PlaybackSessionManager.startSession (C:\snapshot\audiobookshelf\server\managers\PlaybackSessionManager.js))
[2024-08-06 08:13:42.580] DEBUG: [PlaybackSessionManager] closeSession "9a2d5fe6-da94-45c0-8981-327759f00f72" (    at PlaybackSessionManager.closeSession (C:\snapshot\audiobookshelf\server\managers\PlaybackSessionManager.js))
[2024-08-06 08:13:42.582] DEBUG: [PlaybackSessionManager] Removed session "9a2d5fe6-da94-45c0-8981-327759f00f72" (    at PlaybackSessionManager.removeSession (C:\snapshot\audiobookshelf\server\managers\PlaybackSessionManager.js))
[2024-08-06 08:13:55.840] FATAL: [Server] Uncaught exception origin: uncaughtException, error: Error: ENOENT: no such file or directory, open 'C:\Users\shaun\AppData\Local\Temp\pkg-NGVozZ\88e6d330c6f684cce2af952a76696bfc3ba3d62a88e46fd9b599d7b54591a743'
    at Object.openSync (node:fs:599:3)
    at Object.openSync (pkg/prelude/bootstrap.js:793:32)
    at uncompressExternallyAndOpen (pkg/prelude/bootstrap.js:748:19)
    at pkg/prelude/bootstrap.js:763:32
    at FSReqCallback.oncomplete (node:fs:201:23) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\shaun\\AppData\\Local\\Temp\\pkg-NGVozZ\\88e6d330c6f684cce2af952a76696bfc3ba3d62a88e46fd9b599d7b54591a743'
} (    at process.<anonymous> (C:\snapshot\audiobookshelf\server\Server.js))
node:internal/fs/utils:347
    throw err;
    ^

Error: ENOENT: no such file or directory, open 'C:\Users\shaun\AppData\Local\Temp\pkg-NGVozZ\88e6d330c6f684cce2af952a76696bfc3ba3d62a88e46fd9b599d7b54591a743'
    at Object.openSync (node:fs:599:3)
    at Object.openSync (pkg/prelude/bootstrap.js:793:32)
    at uncompressExternallyAndOpen (pkg/prelude/bootstrap.js:748:19)
    at pkg/prelude/bootstrap.js:763:32
    at FSReqCallback.oncomplete (node:fs:201:23) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\shaun\\AppData\\Local\\Temp\\pkg-NGVozZ\\88e6d330c6f684cce2af952a76696bfc3ba3d62a88e46fd9b599d7b54591a743'
}

Node.js v18.5.0
C:\Tools>

@advplyr
Copy link
Owner

advplyr commented Sep 11, 2024

If either of you have gathered any more information about this issue please follow up. I'm not sure what to do with this one.

@coreyemmons
Copy link
Author

I have not had this happen again lately, but we have also had a few complete software updates, so it hasn't run for that long without restarting anyway. You can close this if no one has any other opinions.

@advplyr advplyr closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
@advplyr advplyr removed waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels Sep 11, 2024
@faush01
Copy link
Contributor

faush01 commented Sep 11, 2024

I switch to running from source on windows and have not seen this happen again.

@mikiher
Copy link
Contributor

mikiher commented Sep 12, 2024

Thanks for the reminder.

Let's keep this bug open a little more. I'd like to bring this up with the Yao-pkg maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants