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]: Invalid cover path crashes container #2007

Closed
engirugger42 opened this issue Aug 14, 2023 · 4 comments
Closed

[Bug]: Invalid cover path crashes container #2007

engirugger42 opened this issue Aug 14, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@engirugger42
Copy link

engirugger42 commented Aug 14, 2023

Describe the issue

Editing the cover path to a directory causes the container to crash. Visually, the web app just shows the socket connection failed. I have also tested this with non-image files and files that do not exist, both of these cases are handled correctly. Logs attached.
audiobookshelf-logs.txt
Edit: Debug logs
audiobookshelf-debug-logs.txt

socket connection failed

Steps to reproduce the issue

  1. Go to any audio book, with or without cover art.
  2. Click the edit cover art button.
  3. Change to the path to a directory
  4. Click Save

Audiobookshelf version

2.3.3

How are you running audiobookshelf?

Docker

@engirugger42 engirugger42 added the bug Something isn't working label Aug 14, 2023
@advplyr
Copy link
Owner

advplyr commented Aug 23, 2023

The error log isn't giving us anything useful to go off of. I just tested putting in a bad path, putting in a good path, and putting in a URL to an image. All of those worked properly.

When putting in a path that doesn't exist the server shows this error:

[2023-08-23 17:40:22] ERROR: [CoverManager] validate cover path does not exist "/path/that/does/not/exist/test.png" (CoverManager.js:185)

And I get
image

Can you give more specific details on how to reproduce this error?

@advplyr advplyr added waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels Aug 23, 2023
@engirugger42
Copy link
Author

Sure thing. Specifically, a path ending in a directory with a / is what broke it for me. Visual example:
directory-path

Hitting save at this point will cause a socket disconnect. I just recreated this to get double check, and the container managed to recover, which is not what I observed 2 weeks ago. I have not changed versions in that time, so perhaps I just wasn't patient enough with the container before or my server was just having an off day, in which case this can be closed.

For what its worth, I did some digging in the repo and I believe it's coming from this method in fileUtils when called from this method in CoverManager. I've never been much of a JS guy, much less using the larger frameworks, so apologies if that's not a particularly helpful suggestion.

@advplyr advplyr added awaiting release Issue is resolved and will be in the next release and removed waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels Aug 30, 2023
@advplyr
Copy link
Owner

advplyr commented Aug 30, 2023

I was able to reproduce this. It is specific to entering a file path that exists but is not a file. I fixed it by checking that the path is a file and not a directory.

@advplyr
Copy link
Owner

advplyr commented Sep 9, 2023

Fixed in v2.4.0

@advplyr advplyr closed this as completed Sep 9, 2023
@advplyr advplyr removed the awaiting release Issue is resolved and will be in the next release label Sep 9, 2023
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

2 participants