Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi, I am a newbie in Nodejs. I have a node js application running on my other server. Recently I uploaded the same application in a new server but when uploading data error 500 appears in the console. I can edit existing products but when updating images same appears here too. Is there any issue with the server? because the same files are running on another server and there's no issue there. so I think there's no issue with the code

for reference (from console after clicking add product button)
  POST 500 (Internal Server Error)
t.send @ frame_ant.js:1
send @ jquery-3.3.1.min.js:2
ajax @ jquery-3.3.1.min.js:2
o @ jquery.form.min.js:1
e.fn.ajaxSubmit @ jquery.form.min.js:1
(anonymous) @ admscripts.js:262
dispatch @ jquery-3.3.1.min.js:2
y.handle @ jquery-3.3.1.min.js:2

What I have tried:

I have tried checking permissions and everything seems OK but I still no luck

Dave Kreskowiak 4-Jan-24 11:07am    
500 is a generic error that just means either your server-side crashed for some reason, or something is misconfigured on the server that is making your server-side code crash. With what you've posted, it's impossible for anyone to tell you what went wrong or why.
Hamza Jameel 4-Jan-24 11:18am    
Thank you for replying. What should I paste so you can get it?
I get a bunch of files not found errors on the 404 error page.
NotFoundError: Not Found
at /root/cashback/app.js:321:10
at Layer.handle [as handle_request] (/root/cashback/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/root/cashback/node_modules/express/lib/router/index.js:317:13)
at /root/cashback/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/root/cashback/node_modules/express/lib/router/index.js:335:12)
at next (/root/cashback/node_modules/express/lib/router/index.js:275:10)
at /root/cashback/node_modules/express/lib/router/index.js:635:15
at next (/root/cashback/node_modules/express/lib/router/index.js:260:14)
at Function.handle (/root/cashback/node_modules/express/lib/router/index.js:174:3)
at router (/root/cashback/node_modules/express/lib/router/index.js:47:12)
one common function at this location is function(req, res, next) {
Hamza Jameel 4-Jan-24 11:19am    
I wonder same code is working fine on another server 100% correctly but not here

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900