Azure Service App - Docker - 500 error (NodeJS version?)
Unanswered
Yellow-headed Blackbird posted this in #help-forum
Yellow-headed BlackbirdOP
Hello,
Anyone running nextjs 13.4.X on Azure App Services using Docker container?
As soon as I update my docker version, azure app returns 500.
I think its because of node version, but not sure since I use docker.
Any ideas what might be wrong?
Anyone running nextjs 13.4.X on Azure App Services using Docker container?
As soon as I update my docker version, azure app returns 500.
I think its because of node version, but not sure since I use docker.
Any ideas what might be wrong?
17 Replies
500 means Internal Error so it could be anything. you need to check the logs to narrow down the issue
@Rafael Almeida 500 means Internal Error so it could be anything. you need to check the logs to narrow down the issue
Yellow-headed BlackbirdOP
Yes, but as soon as I revert nextjs version back it works with no issues.
So its only caused moving nextjs versions and only fails on azure.
In package lock i see depencendy from node 14.9 to 16.8.
Was wondering if thats causing it.
So its only caused moving nextjs versions and only fails on azure.
In package lock i see depencendy from node 14.9 to 16.8.
Was wondering if thats causing it.
Yellow-headed BlackbirdOP
I cannot get to sleep once i fix it. haha. found more logs..
Ou this might be actually something old.
Yellow-headed BlackbirdOP
2023-08-21T23:44:40.246895352Z Updated CA certificates
2023-08-21T23:44:42.232335436Z Hosting environment: Production
2023-08-21T23:44:42.232377938Z Content root path: /app
2023-08-21T23:44:42.232385738Z Now listening on: http://[::]:8081
2023-08-21T23:48:09.364902521Z Updated CA certificates
2023-08-21T23:48:11.303152441Z Hosting environment: Production
2023-08-21T23:48:11.303198543Z Content root path: /app
2023-08-21T23:48:11.303206643Z Now listening on: http://[::]:8081
2023-08-21T23:48:31.672106801Z Updated CA certificates
2023-08-21T23:48:33.667258553Z Hosting environment: Production
2023-08-21T23:48:33.667296855Z Content root path: /app
2023-08-21T23:48:33.667304356Z Now listening on: http://[::]:8081
2023-08-21T23:49:03.392824606Z Updated CA certificates
2023-08-21T23:49:05.307919243Z Hosting environment: Production
2023-08-21T23:49:05.307962846Z Content root path: /app
2023-08-21T23:49:05.307970746Z Now listening on: http://[::]:8081
2023-08-21T23:49:52.485680489Z Updated CA certificates
2023-08-21T23:49:54.464029654Z Hosting environment: Production
2023-08-21T23:49:54.464070056Z Content root path: /app
2023-08-21T23:49:54.464077956Z Now listening on: http://[::]:8081
2023-08-21T23:44:42.232335436Z Hosting environment: Production
2023-08-21T23:44:42.232377938Z Content root path: /app
2023-08-21T23:44:42.232385738Z Now listening on: http://[::]:8081
2023-08-21T23:48:09.364902521Z Updated CA certificates
2023-08-21T23:48:11.303152441Z Hosting environment: Production
2023-08-21T23:48:11.303198543Z Content root path: /app
2023-08-21T23:48:11.303206643Z Now listening on: http://[::]:8081
2023-08-21T23:48:31.672106801Z Updated CA certificates
2023-08-21T23:48:33.667258553Z Hosting environment: Production
2023-08-21T23:48:33.667296855Z Content root path: /app
2023-08-21T23:48:33.667304356Z Now listening on: http://[::]:8081
2023-08-21T23:49:03.392824606Z Updated CA certificates
2023-08-21T23:49:05.307919243Z Hosting environment: Production
2023-08-21T23:49:05.307962846Z Content root path: /app
2023-08-21T23:49:05.307970746Z Now listening on: http://[::]:8081
2023-08-21T23:49:52.485680489Z Updated CA certificates
2023-08-21T23:49:54.464029654Z Hosting environment: Production
2023-08-21T23:49:54.464070056Z Content root path: /app
2023-08-21T23:49:54.464077956Z Now listening on: http://[::]:8081
Seems just fine. 

Yellow-headed BlackbirdOP
https://github.com/vercel/next.js/issues/49536
https://github.com/vercel/next.js/commit/83b774eeb69f1fe4f636260f83ed98c6d0717a3d
Ok so did more research of this error i saw in logs:
TypeError: handler is not a function
Looks something really similar to my issue.
I will try to deploy with custom server.js file to see if there is any changes like mentoned in the issues.
https://github.com/vercel/next.js/commit/83b774eeb69f1fe4f636260f83ed98c6d0717a3d
Ok so did more research of this error i saw in logs:
TypeError: handler is not a function
Looks something really similar to my issue.
I will try to deploy with custom server.js file to see if there is any changes like mentoned in the issues.
Does ur docker image work in WSL2 on ur local Win?
Yellow-headed BlackbirdOP
@tafutada777 Does ur docker image work in WSL2 on ur local Win?
Yellow-headed BlackbirdOP
Im actually running on Apple Mac M1
oh. so does it work on Docker on mac?
Yellow-headed BlackbirdOP
Yes, so when using NextJS 13.2.4, the router.refresh() doesnt work in docker, works in dev and live without docker.
When using NextJS 13.4.0, router.refresh() starts working with docker builds. Locally this docker build works for me on M1.
But once its pushed to Azure, it fails with 500, been trying to debug it for hrs 😛
When using NextJS 13.4.0, router.refresh() starts working with docker builds. Locally this docker build works for me on M1.
But once its pushed to Azure, it fails with 500, been trying to debug it for hrs 😛
As soon as i just change verson in nextjs in package json back to 13.2.4 (no other changes) and push to Azure, all again works.
But obviously i lose router.refresh :/
But obviously i lose router.refresh :/
it might be glitch of MS or something. first off, you want to sleep on it.
Yellow-headed BlackbirdOP
thats not the worst suggestion, appreciate it 😄
sleep, shower and coffee work.
Yellow-headed BlackbirdOP
ok.. just tried the custom server.js but it seems outdated,
fails on const { createServerHandler } = require('next/dist/server/lib/render-server-standalone'); 😄
sleep it is.
fails on const { createServerHandler } = require('next/dist/server/lib/render-server-standalone'); 😄
sleep it is.