derhuerst / bvg-rest

An HTTP API for Berlin & Brandenburg public transport.
https://v6.bvg.transport.rest/
ISC License
87 stars 4 forks source link

each Docker container should generate a new hafas-client install ID #4

Closed theottm closed 5 years ago

theottm commented 5 years ago

1.bvg.transport.rest seems down

{"error":true,"msg":"no connection available"}%

derhuerst commented 5 years ago

Thanks for the report! The upstream BVG endpoint (that 1.bvg.transport.rest wraps around) blocks the IP address of my server, so 1.bvg.transport.rest returns "service unavailable" responses.

This can be solved by migrating the server to a new IP or using a different server. Let me know if you have one available.

theottm commented 5 years ago

I have a sleeping EC2 instance that could be used for that.

Tell me how I should have the service running.

I tried to run the docker container as described here with no success. The result message is the same. Never worked with node so I did not tried the npm solution yet, but I could.

derhuerst commented 5 years ago

I have a sleeping EC2 instance that could be used for that.

Cool!

Tell me how I should have the service running.

How would you like to run the service? Via Docker or manually via common Node.js tooling?

I tried to run the docker container as described here with no success. The result message is the same.

Does that mean you get the "no connection available" message back?

I've just tried and running locally via Docker works fine, I get data back. (I checked with curl 'http://localhost:3000/stations/900000100001/departures?duration=1'.)

derhuerst commented 5 years ago

Seems like the service has recovered. Nevertheless, it's helpful to know a) that you're willing to host it and b) what problems you face with the setup.

theottm commented 5 years ago

Yes I did receive the same error message. But if it worked for you I will try to the Docker container again.

theottm commented 5 years ago

Oh great ! I will still try to set up the server, so we can use it in case of another problem :)

theottm commented 5 years ago

It's down again... maybe we should try a rotating IP solution with a proxy list or something.

For now I am not able to run the container properly on my local machine curl 'localhost:3000/journeys?from=900000017104&to=900000017101' while the container is running returns me : {"error":true,"msg":"VBB error: Service Unavailable"}

derhuerst commented 5 years ago

VBB error: Service Unavailable

AFAIR that is their endpoint reporting downtime, not your IP being blocked. Errors like ECONNRESET or ETIMEDOUT hint that your IP has been blocked.

derhuerst commented 5 years ago

We investigated further and found a bug: The install-unique ID generated by hafas-client (which is a dependency of bvg-rest) is being built into the Docker image. It should be regenerated on container start in addition.

@theottm Would you mind submitting the fix?

theottm commented 5 years ago

Thanks, didn't find the time today. Glad it works again :)