bookwyrm-social / bookwyrm

Social reading and reviewing, decentralized with ActivityPub
http://joinbookwyrm.com/
Other
2.26k stars 265 forks source link

Cannot add book #2121

Closed airdogvan closed 2 years ago

airdogvan commented 2 years ago

When I try to add a book I get error message from the web page.

Docker logs show the following error:

[error] 30#30: *112520 directory index of "/app/static/" is forbidden

Running version "0.3.4

I noticed that in the docker-compose the volume is mapped as: static_volume:/app/static

but there is no static_volume in my file structure.

mouse-reeve commented 2 years ago

It's normal that there isn't a static_volume in your file structure, since it's a docker volume rather than a directory. When you create a book it should be saving the cover to media, not static, which is for assets that are part of the app, not user -generated content. Is there anything you've changed in your .env file or docker-compose file that might be related to that?

mouse-reeve commented 2 years ago

And, does creating a book work when there is no cover image?

airdogvan commented 2 years ago

Of course, I haven't really written a docker-compose for a while so I forgot the volume is kept in /var/lib/docker/volumes...

And no the absence of cover image leads to the same result.

Didn't have this problem in previous versions by the way.

mouse-reeve commented 2 years ago

Can you give me more details about how you're adding a book? For example, are you adding a new book via the link in the search results, or adding another edition to an existing work via the "editions" page? I'm having trouble replicating this error locally (although I did find a logic problem with the add book flow, fixed by #2127

Neriderc commented 2 years ago

Can I chime in here and say I'm having the same issue, with only one book in particular.

I search for a book, and then try to import the book from the search results. The book in question is this one: https://bookwyrm.social/book/282741/s/guards-guards

I've added a dozen others the same way without issue.

I get a very similar error to the original author: [error] 31#31: *683 directory index of "/app/static/" is forbidden

mouse-reeve commented 2 years ago

@Neriderc Interesting! When I tried to load that book, I got an ActivitySerializerError at /resolve-book

airdogvan commented 2 years ago

Sorry for the late answer.

I fist seach for the book I need to add. In my case the book title was "La rage" of course it wasn't found on any of the other sites so I chose from the bottom "add manually"

In the blank form I added the title: La rage and the author: Zygmunt Miłoszewski as well the the publishing date : Sept 2014.

When I press save I get the already described error message.

Tried many times (a few times after logging out and back in) with the same results.

Hope this helps.

mouse-reeve commented 2 years ago

@Neriderc #2133 may help with your issue (maybe?), but I don't expect it to help at all with @airdogvan's issue.

mouse-reeve commented 2 years ago

What operating system are you using? A similar issue came up in the matrix chat and the problem seemed to be present on Debian and not on Ubuntu

airdogvan commented 2 years ago

The host OS is Ubuntu 20.04 LTS. But please don't forget that I'm running the docker version.

About docker, I'm running docker rootless which can sometimes create access rights problems.

But I didn't see any indication of that in the docker logs. And as a reminder I added many books (both import and manual add) in previous versions without any issues.

mouse-reeve commented 2 years ago

It sounds like it's a problem with docker permissions, and I'll be honest, I have no clue how to debug it. You can try in the matrix chat room and see if anyone else has ideas. Sorry not to be more help!

airdogvan commented 2 years ago

Ok then why would it happen now and not before?

And as said I've had permission problems in docker before but they always clearly show up in the logs with something such as " could not access file xx" or " permission denied".

But in this case nothing even close.

I've been running rootless for quite a while now and can spot those kind of problems real quick.

As far as I'm concerned anyone running docker not rootless is ruining kamikaze style, asking for a breach to happen.

mouse-reeve commented 2 years ago

It's very odd! I truly have no idea, and I was referring to docker permissions very loosely, I didn't mean to imply you were using it incorrectly.

airdogvan commented 2 years ago

I'm curious. Can you reproduce the problem? Trying to manually add the book with the author and title I've given you?

Can you add that book without any problems? I forgot if I tried without the publication date. I know that with the date included doesn't work. Worst case scenario if you can add it I should be able to then import it...

And BTW I can import books without problems in the new version. And unless it just creates a link to the original content it should also add to my library, no? Which would create the same permissions problems.

mouse-reeve commented 2 years ago

Yes, I've tried to replicate it using you data and it's worked for me. I also haven't seen any errors similar to this on b.s's Sentry, which is why I was asking about Docker configuration and operating system -- it doesn't seem to be happening consistent across instances

airdogvan commented 2 years ago

Can't find it when I do a search...

mouse-reeve commented 2 years ago

I tried it on my local test instance. I'll add it on b.s now

mouse-reeve commented 2 years ago

I was able to import it from OpenLibrary: https://bookwyrm.social/book/442597/s/la-rage

airdogvan commented 2 years ago

Ok found it and was able to add without problems. Strange!!! Thanks for the dedication, much appreciated. No time today but tomorrow I'll try to manually add another one to see what happens. Will let you know.

airdogvan commented 2 years ago

well you will not believe this but I manually added without any issues whatsoever a book called test book authored by airdog van. Not sure what to make of this.... Maybe something in the other author's name??? Zygmunt Miłoszewski??? I noticed that in your version the "l" in Miloszewski has a bar crossing it and mine didn't. Is that even possible as a eventual cause for failure to add???

mouse-reeve commented 2 years ago

I would be surprised if it was related to the content of the data; there are lots of books and authors in various character sets.

airdogvan commented 2 years ago

so would I. So this particular case is going to remain a mystery!!!! Again thanks for your help and dedication, once again very much appreciated when a developer stands behind his work like you do. And also would like to say that this site is important to me as I read regularly and was looking for a viable alternative to goodreads.
I still register my read books on goodreads (just in case) but only review them on my site. Kudos and thanks to you!!!

airdogvan commented 2 years ago

I was thinking, is it possible that when adding a book your software does some kind of check on spelling for the author's name and if the spelling is incorrect (which it was in my case with the wrong "l") it issues an error? That would explain why I was able to add a book by an non existing author (airdog van) for which the correctness of the name could not be verified but not one by an existing author whose name was not written correctly. Long shot, but just a thought.

mouse-reeve commented 2 years ago

There isn't really a way to spell check names, because they're so free-form. There is a check that tries to find existing similar authors, and authors in the ISNI database, which can help avoid mistakes like that.

airdogvan commented 2 years ago

But I was right there is a check. And what does it do when if finds similar author? Displays list of possible authors?

I've been at software ( producer and user) for a long time and developed some kind of sixth sense. This tells me that the error is not related to docker and probably occurs during some kind of checking.

Of course I could be wrong...

mouse-reeve commented 2 years ago

When you create a new book, it should take you to a confirmation page that shows you existing author matches (and existing works); for example:

Screen Shot 2022-05-31 at 1 27 22 PM