Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend gets 500 Internal Server error for all /api/* requests #2039

Open
GeorgeGkinis opened this issue Feb 14, 2025 · 4 comments
Open

Frontend gets 500 Internal Server error for all /api/* requests #2039

GeorgeGkinis opened this issue Feb 14, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@GeorgeGkinis
Copy link

Bug Report

Which version of the demo you are using?
https://github.com/open-telemetry/opentelemetry-demo/releases/tag/1.12.0

Docker compose startup.

Symptom

The frontend cannot connect to underlying services:

frontend  | 
frontend  | > frontend@0.1.0 start
frontend  | > node --dns-result-order=ipv4first --require ./Instrumentation.js server.js
frontend  | 
frontend  |    ▲ Next.js 15.1.6
frontend  |    - Local:        http://bd64981aab7e:8080
frontend  |    - Network:      http://bd64981aab7e:8080
frontend  | 
frontend  |  ✓ Starting...
frontend  |  ✓ Ready in 458ms
frontend  |  ⨯ Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:903)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/checkout.js:1:914)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |     at 70 (.next/server/pages/api/checkout.js:1:777)
frontend  |     at o (.next/server/webpack-api-runtime.js:1:127)
frontend  |     at <unknown> (.next/server/pages/api/checkout.js:1:1937)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:1363)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/data.js:1:901)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |     at 6875 (.next/server/pages/api/data.js:1:770)
frontend  |     at o (.next/server/webpack-api-runtime.js:1:127)
frontend  |     at <unknown> (.next/server/pages/api/data.js:1:1136)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:1778)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:1778)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/recommendations.js:1:1730)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |     at 2720 (.next/server/pages/api/recommendations.js:1:1587)
frontend  |     at o (.next/server/webpack-api-runtime.js:1:127)
frontend  |     at <unknown> (.next/server/pages/api/recommendations.js:1:2003)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/shipping.js:1:1324)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |     at 1176 (.next/server/pages/api/shipping.js:1:1187)
frontend  |     at o (.next/server/webpack-api-runtime.js:1:127)
frontend  |     at <unknown> (.next/server/pages/api/shipping.js:1:1578)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |  ⨯ Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:1778)
frontend  | (node:17) MetadataLookupWarning: received unexpected error = network timeout at: http://169.254.169.254/computeMetadata/v1/instance code = UNKNOWN
frontend  | (Use `node --trace-warnings ...` to show where the warning was created)
frontend  |  ⨯ Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:903)
frontend  |  ⨯ Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/recommendations.js:1:1730)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |     at 2720 (.next/server/pages/api/recommendations.js:1:1587)
frontend  |     at o (.next/server/webpack-api-runtime.js:1:127)
frontend  |     at <unknown> (.next/server/pages/api/recommendations.js:1:2003)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |  ⨯ Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:1778)
frontend  |  ⨯ Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:903)

I see that next.js listens on ipv6.
I tried to disable it with --dns-result-order=ipv4first but to no avail.
Maybe if i somehow configure next.js to listen to 0.0.0.0?
How should I do that?

What is the expected behavior?

The frontend works correctly

What is the actual behavior?

I get 500 Internal Serer Error for all /api/* requests as seenfrom the developer tools in the browser

Reproduce

I run in a air-gapped RHEL VM.

make start

Additional Context

Please feel free to add any other context about the problem here.

@GeorgeGkinis GeorgeGkinis added the bug Something isn't working label Feb 14, 2025
@GeorgeGkinis GeorgeGkinis changed the title rontend gets 500 Internal Server error for all /api/* requests Frontend gets 500 Internal Server error for all /api/* requests Feb 14, 2025
@GeorgeGkinis
Copy link
Author

I started the frontent providing the env variable: HOSTNAME=0.0.0.0
The server now listens on ipv4 but still the same output:

frontend  | 
frontend  | > frontend@0.1.0 start
frontend  | > node --dns-result-order=ipv4first --require ./Instrumentation.js server.js
frontend  | 
frontend  |    ▲ Next.js 15.1.6
frontend  |    - Local:        http://localhost:8080
frontend  |    - Network:      http://0.0.0.0:8080
frontend  | 
frontend  |  ✓ Starting...
frontend  |  ✓ Ready in 425ms
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/checkout.js:1:914)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |     at 70 (.next/server/pages/api/checkout.js:1:777)
frontend  |     at o (.next/server/webpack-api-runtime.js:1:127)
frontend  |     at <unknown> (.next/server/pages/api/checkout.js:1:1937)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:1363)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/data.js:1:901)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |     at 6875 (.next/server/pages/api/data.js:1:770)
frontend  |     at o (.next/server/webpack-api-runtime.js:1:127)
frontend  |     at <unknown> (.next/server/pages/api/data.js:1:1136)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:1778)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/cart.js:1:1778)
frontend  | Error: Could not parse target name ""
frontend  |     at <unknown> (.next/server/pages/api/recommendations.js:1:1730)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)
frontend  |     at 2720 (.next/server/pages/api/recommendations.js:1:1587)
frontend  |     at o (.next/server/webpack-api-runtime.js:1:127)
frontend  |     at <unknown> (.next/server/pages/api/recommendations.js:1:2003)
frontend  |     at o.a (.next/server/webpack-api-runtime.js:1:866)

...
...

@GeorgeGkinis
Copy link
Author

GeorgeGkinis commented Feb 15, 2025

I replicated this issue on a private Ubuntu 20.04 installation using release tag 1.12.0 and encountered the same behavior.

When I used the main branch everything worked out, so hopefully this will be resolved with the next release.

@GeorgeGkinis
Copy link
Author

in the .env file for tag 1.12.0 the version 1.11.1 images are being used:

IMAGE_VERSION=1.11.1

Was this intended?

@puckpuck
Copy link
Contributor

in the .env file for tag 1.12.0 the version 1.11.1 images are being used:

opentelemetry-demo/.env

Line 4 in 2d4661e

IMAGE_VERSION=1.11.1
Was this intended?

This brings up an interesting point. Our current guidelines for a release are to create the release first and then update this file. The release is done first because the demo repo would be broken while the somewhat long build and package process takes place for a demo release. However, I can see someone trying to pull for a specific release and not getting precisely as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants