jasonwu

jasonwu

Web Development with Clojure, Third Edition: "Internal Server Error" when trying to log in

Hi Dmitri Sotnikov @dmitri and Scot Brown @svmbrown,

I am trying to run some of the source code. Sometimes I’m able to log in fine (running guestbook-feeds-2 for example) and other times, I get “Internal Server Error” (for example, with guestbook-session). This happens with both “Log in” and “Register” where I get “Internal Server Error.” Is this something to do with Postgres? How do I debug this?

Thank you!

First Post!

jasonwu

jasonwu

Just figured out what I was doing wrong. I couldn’t log in with any of the code before guestbook-profile, but at guestbook-profile it started working again.

My error: I was using the same database with everything. The database used in the last part of the book has JSONB added to it, and JSONB stuff in the code to deal with that. So when I ran code from the first part, the code didn’t have the JSONB stuff, but the database had it, so it wasn’t working.

Solution: If I add the json library to the project.clj file, and change db/core.clj according to the guestbook-profile instructions, and I also updated the queries to be safe, now I can log in fine.

Leaving my post up in case there are other newbies like me who are new to JSONB and how that affects the database and code.

Where Next?

Popular Pragmatic Bookshelf topics Top

simonpeter
When I try the command to create a pair of migration files I get an error. user=> (create-migration "guestbook") Execution error (Ill...
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
New
mikecargal
Title: Hands-on Rust: question about get_component (page 295) (feel free to respond. “You dug you’re own hole… good luck”) I have somet...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
New
gilesdotcodes
In case this helps anyone, I’ve had issues setting up the rails source code. Here were the solutions: In Gemfile, change gem 'rails' t...
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New

Sub Categories: