Unable to fetch data from GCP
This is a sort of urgent.
So, I am unable to fetch data from Google Cloud Platform using Dokploy. Example;
https://taskuri-nextjs-j7ieak-204699-91-99-89-142.traefik.me/api/get-user-ip/ - if (E) it means Error. This is hosted on Hetzner VPS, it gives me an error. If I curl from VPS (not via NextJS app which is routed through Traefik) then it works. This means that Hetzner VPS Public IP isn't banned by GCP.
Could it be a problem with the NextJS app? No, because the same hosted on Vercel works fine. Working live example: https://taskuri.ro/api/get-user-ip/
I attached an Image to show proof that curl from VPS works.

39 Replies
Also, I did curl via the Docker Terminal of the app and it did curl successfully.
So if there is nothing wrong with Docker container, then why NextJS API route doesn't work via Dokploy but the same code and deployment works via Vercel?

You don't have a valid cert for that domain

Certificates | Dokploy
Configure your certificates to secure your applications.
Hi Henrik, ty for your prompt reply. I don't think its an SSL issue. I assigned Dokploy to another domain so;
https://taskuri.md/api/get-user-ip - Dokploy
https://taskuri.ro/api/get-user-ip - Vercel
(E) Means it doesn't work
I'll have to test something real quick
I initially thought Hetzner's IPv4 addresses were getting banned, but they aren't
What header are you extracting for the IP? Is it
X-Forwarded-For
?sec
my exact code is
but again I don't think its with header. Because I can see their IP

Sure those are case insensitive?
console.log looks like its giving me the IP

so likely yes
Hard to debug from those symptoms. Check if your program has problems calling out to other APIs.
A wild long shot is outdated CA files in the container, but I doubt it
Nope, I even put it behind Cloudflare SSL for almost a week and same stuff
It's doesn't sound like an ingress issue, but it's your outgoing connection to ipinfo
You're getting the header you want to have
Yep
If you want you can use my vps to test yourself
I am using the app.dokploy.com to manage the VPS
Welcome to vendor lock, I also think it's something about how docker networks handle reading the ip of a request
You sure that's the issue?
I really think it's something like docker handling networks, I remember I had a similar problem
I think someone here had solved this problem.
Idk if you guys see my Projects, but if you don't and is of any help i am using Nixpacks
it shouldn't affect what kind of builder you are using, it's more related to traefik and docker
It could be Traefik if it was an ingress issue, it doesn’t sound like that’s the issue
Get a shell inside the container and check if the service is reachable from there
sec

I did it also via SSH (shelled into container) (not Dokplay UI) and service is reachable
That would give the same outcome, but I understand the try everything mentality. I’m kinda out of ideas right now
My only curiosity at this point is to see whether you could reproduce it on your end
I can give you my code and see whether you get this eror with Hetzner (or other VPS) and not Vercel
Sure
So take this API route, and deploy the app on both Vercel and a Dokplay VPS and let us know
I am not going to sleep 😄 but wait for this
if its of any help: an hour earlier before the timeout error I used to get HTTP 403. Their docs say: https://community.ipinfo.io/t/getting-403-forbidden-when-accessing-the-ipinfo-api-and-website/303
IPinfo Community
Getting 403 forbidden when accessing the IPinfo API and website
If a user receives a 403 status when accessing our website or API, it means that our servers understood their request but refused it. This error can occur for a number of reasons. In some instances, this may be due to international regulations and infrastructure policies. Our cloud infrastructure is based on Google Cloud Platform (GCP), whic...
Worked like a charm

This was also done with a Hetzner VPS
I’ll start fresh as well in a couple of hours.
Thank you so much for trying out
Hi Henrik, again it's me.
https://github.com/alexclinky/ipinfo <- this is the GitHub repo and it still doesn't work on my setup.
http://taskuri-ipinfo-ypxahg-5e5696-91-99-89-142.traefik.me/api/get-user-ip - Dokploy (doesn't work)
GitHub
GitHub - alexclinky/ipinfo
Contribute to alexclinky/ipinfo development by creating an account on GitHub.
and again curl from same docker container works
now I am even more confused. Why does it work in your Dokploy config, and not mine...
It looks awfully similar to what I deployed. I also used nixpack.
Henrik, if you dont mind can you give me your route.ts code?:D
I made changes to my git repo to keep on trying to figure out what's happening. What I found out through my reproduction git repo tests;
1. await Promise - doesn't work on Dokploy, they are simply ignored
2. console.log in nextjs server components doesn't get reported in Dokploy logs menu tab - simply ignored
3. If I just put the IP address (without taking it from Headers) then it successfully fetches from ipinfo.io. As soon as I add Headers in server side code, ipinfo fails. (I think this is the reason why you were able to see your IP info, because you hard coded it)