4

I try to run my simple Web-App as Docker Container within Heroku. When build and run the container locally all works fine.

But on accessing the generated endpoint https://html5-landingpage-buddah.herokuapp.com/ Heroku responses with HTTP 400 Bad Request and the message "Not authoritative"

Logs inside Heroku don't help much:

2020-09-19T14:45:45.269487+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=5f07ea7e-d925-4fbe-b7ba-29387a3284cc fwd="XX.XX.XX.XXX" dyno=web.1 connect=1ms service=1ms status=400 bytes=212 protocol=https

I did a research for the error but found no helpful information. Also re-creating the App in Heroku, renaming the URL and moving the App to another Region did not help.


Here is the log from restart to the first request on the web app:

2021-06-15T17:11:36.977277+00:00 heroku[web.1]: Starting process with command `./app`
2021-06-15T17:11:39.852345+00:00 app[web.1]: [main] INFO de.clique.westwood.example.html5.landingpage.buddah.App - Server started on port 54225
2021-06-15T17:11:39.852374+00:00 app[web.1]: [main] INFO de.clique.westwood.example.html5.landingpage.buddah.App - Serving albums from ./static/album
2021-06-15T17:11:41.363857+00:00 heroku[web.1]: State changed from starting to up
2021-06-15T17:11:48.162254+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=85c642cb-a48d-41ac-89e1-7a520749e9bc fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.275223+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=406e9e77-f40e-47b9-a33b-af0af5b8f171 fwd="94.31.82.142" dyno=web.1 connect=1ms service=3ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.520876+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=html5-landingpage-buddah.herokuapp.com request_id=d3782734-765c-45f1-98a8-04e2098e7267 fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.906097+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=html5-landingpage-buddah.herokuapp.com request_id=79e4404f-e505-4c16-9778-9f72882d74be fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https
Yeong Jong Lim
  • 208
  • 1
  • 4
Oliver
  • 332
  • 1
  • 11
  • 1
    Provide log. From the moment you first start the app to the moment you open the website. The log you provided is not relevant to your app. It's the `router` and not your application. Furthermore provide build.log. – Tin Nguyen Jun 10 '21 at 13:59

1 Answers1

0

The error Not Authoritative simply means that Heroku is unable to redirect the traffic from the said domain name to your application.

According to Heroku,

The web process must listen for HTTP traffic on $PORT, which is set by Heroku. EXPOSE in Dockerfile is not respected, but can be used for local testing. Only HTTP requests are supported.

You will need to replace your EXPOSE and ENTRYPOINT as such

CMD [ "sh", "-c", "java -jar ./app --bind 0.0.0.0:$PORT" ]
Yeong Jong Lim
  • 208
  • 1
  • 4
  • 1
    With your solution the same problem stays. Please note that I compile my java programm to a native executable (see dockerfile in the linked git repository). Therfore I changed your command to: CMD [ "sh", "-c", "./app --bind 0.0.0.0:$PORT" ] This is the same as in the current version this works well on my machine. But deployed on Heroku occurs the same error appears. – Oliver Jun 17 '21 at 05:01
  • Here the logs heroku[web.1]: Starting process with command `sh -c ./app\ --bind\ 0.0.0.0:\17829` app[web.1]: [main] INFO de.clique.westwood.example.html5.landingpage.buddah.App - Server started on port 17829 app[web.1]: [main] INFO de.clique.westwood.example.html5.landingpage.buddah.App - Serving albums from ./static/album heroku[web.1]: State changed from starting to up heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=5b509c13-9ea9-45d3-8d95-129c2470f2b6 fwd="4.3.2.1" dyno=web.1 connect=1ms service=2ms status=421 bytes=219 protocol=https – Oliver Jun 17 '21 at 05:04