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

Internal server error when adding book to database #68

Open
ZooeyMiller opened this issue Nov 3, 2017 · 3 comments
Open

Internal server error when adding book to database #68

ZooeyMiller opened this issue Nov 3, 2017 · 3 comments

Comments

@ZooeyMiller
Copy link
Contributor

When adding a book to the database I got an internal server error, I'm unsure what caused this, but when I refreshed the book had been properly added.

This warrants further investigation.

@iteles
Copy link
Member

iteles commented Nov 3, 2017

I got the same internal server error when I logged in for the first time.
Granted access and got internal server error but when I refreshed, I was logged in.
screen shot 2017-11-03 at 14 09 31
screen shot 2017-11-03 at 14 10 37

@finnhodgkin
Copy link
Contributor

The bug was there, I re-deployed through the Heroku dashboard and now it seems to be working again. I didn't even change anything, I was just prepping a debug branch with logs in a bunch of places but thought I'd try a restart first 😢

I hate problems that fix themselves, it's so frustrating!

@finnhodgkin
Copy link
Contributor

finnhodgkin commented Nov 4, 2017

I couldn't get the login bug to repeat. I'll try it on another Github account in another browser to double check 👍 Update couldn't get it to repeat with a clean account/no cookies.

Before restarting I checked the logs and the search/add seemed to be breaking on the Google API search, which to be fair on first inspection does have some unreliable code like the following:

...
map
  |> Map.get("items")
  |> Enum.reduce([], fn (%{"volumeInfo" => map}, acc) ->
...

If the map doesn't have items (which it won't if there are any problems with the API call) then Enum.reduce will attempt to run on nil and crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants