Can't add books from my localhost

yes @prabalsingh24 , i added them!
And by the way, i have done all the installation and configuration using ubuntu.

How’re you running your code? npm start? or npm start -- --config ./config/config.local.json

@prabalsingh24 i am doing npm start

You need to mention config file also. Here

1 Like

Hey @Prabhleen
I also faced the same issue at the start.
One thing you should know about our bookbrainz project…
It is SERVER SIDE RENDERED(SSR) react application meaning whenever you click on a button eg. Add button it triggers a route and then server sends a markup and other required stuffs to client side.
So in my case my server was not running well, and that’s why whenever I clicked ADD button I get nothing…

So please check in console, if something is wrong or what!!!

In short, check the console where server is running…

1 Like

@prabalsingh24 i did npm start -- --config ./config/config.json because i made changes to config.json like below but the problem is not resolved. @mr_monkey clearly mentioned here to use npm start:

@endurance21 i am getting this elasticsearch error:

Warning: Failed prop type: Invalid prop error.detailedMessage of type array supplied to ErrorPage, expected string.
in ErrorPage
HEAD /bookbrainz 404 126.682 ms - 8489
HEAD /bookbrainz 404 19.137 ms - 8489
PUT /bookbrainz 404 1539.929 ms - 8489
(node:29861) UnhandledPromiseRejectionWarning: Error: Not Found
at respond (/home/prabh_leen/bookbrainz-site/node_modules/elasticsearch/src/lib/transport.js:308:15)
at checkRespForFailure (/home/prabh_leen/bookbrainz-site/node_modules/elasticsearch/src/lib/transport.js:267:7)
at HttpConnector. (/home/prabh_leen/bookbrainz-site/node_modules/elasticsearch/src/lib/connectors/http.js:165:7)
at IncomingMessage.wrapper (/home/prabh_leen/bookbrainz-site/node_modules/lodash/lodash.js:4929:19)
at IncomingMessage.emit (events.js:323:22)
at endReadableNT (_stream_readable.js:1204:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:29861) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line API | Node.js v21.5.0 Documentation). (rejection id: 1)
(node:29861) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@Prabhleen
Luckily I got the same error a while ago.:sweat_smile:
So now let’s discuss how to fix that.

are you getting the same error now also?
i mean where are you running your localhost then, to avoid the error?

I actually shifted to docker back then :sweat_smile::sweat_smile:

1 Like

@Prabhleen
Please confirm that, elastisearch is running
By applying this in terminal.
“Sudo systemctl status elastisearch”
and report the message it gives.

it gives: System has not been booted with systemd as init system (PID 1). Can't operate.

when i do:sudo service status elasticsearch, i get: status: unrecognized service

Then try this one
“Sudo service elastisearch status” :sweat_smile:

I/P:sudo service elasticsearch status
O/P: * elasticsearch is not running

I knew that :sweat_smile::sweat_smile:
So now
Do the following

“Sudo service elasticsearch start”
again check the status after that.

ok, so i started elasticsearch and confirmed the same from status, but then again when i run npm start, the problm is still the same, and error message too.

@Prabhleen
It hurts :joy::sweat_smile:
Let me figure out the things
@prabalsingh24
Is there something you can think of it?.

1 Like

truly! :sweat_smile:

@mr_monkey i need help to continue!

@Prabhleen
Report the error message by using this command.
“Npm start - - unhandled-rejections=strict”

Hi @Prabhleen!

The red banner you see at the top of the website locally (“We are currently experiencing difficulties…”) means that the web server can’t communicate with redis (we use it to store user sessions).

That means either redis is not running or the server can’t communicate with it.
In that state, it’s impossible to log in to the website, which in turn means you won’t be able to edit anything.

So first, make sure that redis is running.
Try the command curl localhost:6379 (6379 is the default redis port) in your terminal; if not running, you’ll get something like “Failed to connect to localhost port 6379: Connection refused”.
If it is running correctly, you’ll get another message “-ERR wrong number of arguments for ‘get’ command” (never mind that it’s an error, we just want to know it’s running)

If it is running fine and you still have that red banner, check the “session” part of your config.json file, and make sure you are pointing to the correct address and port. If redis is running with its default, it should be

"redis": {
	"host": "localhost",
	"port": 6379
}

Let me know how that went for you.