How to find out why I get 500 error from Firebase on server but not on localhost - node.js

I try to run my first node application on my server from subdomain. It works perfectly on my PC but when I move it to the server, seems everything works, site loads with all js except Firebase.
I get the following errors in chrome:
/firebase/firestore net::ERR_ABORTED 500 (Internal Server Error)
/firebase/app net::ERR_ABORTED 500 (Internal Server Error)
The 2 lines of my my .js triggers the error:
import firebase from '/firebase/app';
import '/firebase/firestore';
Obviously it can mean millions different issues but I have no idea how to find any logs or anything what would tell me why this error triggered.
I tried to turn off/on https. I checked logs on server but found nothing just the same 500 error in access log. I tried but couldn't find any node specific log on the server. I tried to re-install firebase. After I tried to re-install node and everything and re-started from scratch.
I tried to copy the whole node_modules folder to the server from my PC but didn't help.
I would expect it to run just as on localhost or at least see some log about the error so I could fix it. The server is Linux VPS with plesk obsidian. The app is on a subdomain, the main domain has php website running.

Related

Nest JS server returning 404 response to all the routes after changing node JS version on my machine

I am running my Nest JS application on my local server's PORT 3000 and my node version is 16.5.0. My application has multiple routes and all were giving correct responses. There was a requirement where I had to downgrade the node version to 14.17.0. After this change, I started my server again and here the problem comes. All the routes started giving the response like POST /user 404 not found and GET /user/:id 404 not found.
I have reverted back to node version 16.5.0 and removed the node_modules and re-installed it again and restarted the server as well. But still, I am getting the same issue.
All the approaches I tried above failed to resolve the issue. The only way which resolved the issue is by restarting the system and running the server again.

Unable to fix NGINX 502: Bad Gateway error on a Digital Ocean droplet - Ubuntu 20.04

I have deployed my website to a Digital Ocean droplet (Ubuntu 20.04 server).
Everything was working fine. Today, I did some changes to the website in my local machine. So I pushed the changes to GitHub and then cloned the GitHub repo again to the server. Then, I installed the dependencies and restarted PM2.
Now, when I visit my site https://sundaray.io, I get the following error.
The following is the error log.
How can I fix the error?
Simple meaning is
No HTTP server response, your Node Http server is not answering requests.
502 gateway mean server and Nginx is getting your request but there is issue with upstream.
you can use the command to show the logs of pm2
pm2 show
the application might be crashing or internal server 500 error.

The Nginx server returns error 502 for some directories (Express Application)

I'm running an express application using nginx web server on Ubuntu. everything works fine but today when I added two more directories using app.get method and re-deploy my app, the new directories won't work and it returns 502 Bad Gateway errors (old directoriesn are working fine). Restarting pm2, nginx and the server itself didn't help. What should I do?
After a couple of hours I realized that the problem was in my code and not relevant to nginx. But because of pm2 the server would not crash to help me find that out.
running normal run command:
node server.js
revealed the mistake

Angular 2 Routing with Amazon EC2 404 error

I am trying to get a deployment of a MEAN stack app using angular2 v1.0.0 beta.3 up and running. Everything is going well so far except this annoying routing issue that did NOT occur when I deployed to Heroku. However; this is my first experience deploying to ec2 using elastic beanstalk.
When I open up the route at the base route / the page loads as normal and I can use the app as if nothing is wrong. However, if I navigate to a subroute, in my case /client/issue/:id , the state loads, but if I reload the page I will get a 404 ERROR. In my server.js I have what I thought was a 404 catch app.get('*', loadIndex'), but this does not seem to be the case. I assume it is an issue with the way ec2 handles routing, but I am not sure.
EDIT
It might also be worth noting that I am only getting an error in my /var/log/nginx/error.log file and not the /var/log/nodejs/nodejs.log file.
From the error.log file:
2016/04/06 15:14:00 [error] 18952#0: *16 open() "/var/app/current/client/Issue/yes/57044092fe1924e77d9049ab" failed (2: No such file or directory), client: 172.31.4.202, server: , request: "GET /client/Issue/yes/57044092fe1924e77d9049ab HTTP/1.1",

Error 404 for every requests on the VPS, not on localhost

I ve managed to install and run my Jhipster application on a Debian VPS. The homepage shows.
But when I'm trying to authenticate I m getting a :
/app/rest/account 404 (Not
Found)
As it works on my computer, I m trying to find out why it doesn't on the VPS.
Are there settings to do on the VPS?
Thanks in advance.

Resources