I got my app successfully (or at least it seemed to be) uploaded to heroku. Everything said it was successful, but then when I try to hit the "Open App" button on that app's heroku page it returns with a 404 error.
2021-03-14T22:35:00.849056+00:00 app[web.1]: [2021-03-14 22:35:00 +0000] [5] [INFO] Using worker: sync
2021-03-14T22:35:00.852727+00:00 app[web.1]: [2021-03-14 22:35:00 +0000] [7] [INFO] Booting worker with pid: 7
2021-03-14T22:35:00.942754+00:00 heroku[web.1]: State changed from starting to up
2021-03-14T22:42:41.838136+00:00 heroku[router]: at=info method=GET path="/" host=cupboardcobble.herokuapp.com request_id=605b3d3a-55ac-458a-aa9b-d5e76a1a5331 fwd="73.80.9.120" dyno=web.1 connect=0ms service=3ms status=404 bytes=432 protocol=https
That is what it shows when I run "heroku logs --tail --app cupboardcobble" in the terminal. If I look up earlier in the log I see the "h10" code, but I have not been able to locate the possible reason for this. This is a react-redux based front end, and a flask based backend with docker. Any help would be really appreciated.
Related
Application error
An error occurred in the application and your page
could not be served. If you are the application owner, check your logs
for details. You can do this from the Heroku CLI with the command
heroku logs --tail
How can i resolve this?
Heroku logs
2010-09-16T15:13:46.677020+00:00 app[web.1]: Processing PostController#list (for 208.39.138.12 at 2010-09-16 15:13:46) [GET]
2010-09-16T15:13:46.677023+00:00 app[web.1]: Rendering template within layouts/application
2010-09-16T15:13:46.677902+00:00 app[web.1]: Rendering post/list
2010-09-16T15:13:46.678990+00:00 app[web.1]: Rendered includes/_header (0.1ms)
2010-09-16T15:13:46.698234+00:00 app[web.1]: Completed in 74ms (View: 31, DB: 40) | 200 OK [http://myapp.heroku.com/]
2010-09-16T15:13:46.723498+00:00 heroku[router]: at=info method=GET path="/posts" host=myapp.herokuapp.com" fwd="204.204.204.204" dyno=web.1 connect=1ms service=18ms status=200 bytes=975
2010-09-16T15:13:47.893472+00:00 app[worker.1]: 2 jobs processed at 16.6761 j/s, 0 failed ...
I am in the process of uploading an application I developed on my local PC to Heroku. It has a Springboot backend accessing a Postgresql database and a React\Axios front end.
I uploaded the source to GITHUB and created a project in Heroku and deployed from Heroku. I created the Postgresql database, deployed the Backend and Front end. The React Front end executes and paints the screen, but no data is sent from the backend. I do not think I have the proper pointers in the front end to the backend. Possibly the backend is not seeing the database. The backend did see the POSTGRESQL database locally as I tested with POSTMAN. Not sure how to test with POSTMAN with a remote database. Dataclips Query works within Heroku.
Any help with this would be appreciated.
React Front End Axios URL before:
export const USER_API_BASE_URL = "http://localhost:8080/api/v1/";
React Front End Axios URL after:
export const USER_API_BASE_URL =
"postgres://xmmazemfflgbkj:a323bc337c559fffd0ec7029daaf60f03712cdb1df41ca8629fe8429f0a7a607#ec2-54-85-113-73.compute-1.amazonaws.com:5432/d423nfcf5dbjf7";
Spring Boot application.properties before
spring.datasource.url=jdbc:postgresql://localhost:5432/budgettool
spring.datasource.username=postgres
spring.datasource.password=admin
Spring Boot application.properties after
spring.datasource.url=postgres://xmmazemfflgbkj:a323bc337c559fffd0ec7029daaf60f03712cdb1df41ca8629fe8429f0a7a607#ec2-54-85-113-73.compute-1.amazonaws.com:5432/d423nfcf5dbjf7
spring.datasource.username=xmmazemfflgbkj
spring.datasource.password=a323bc337c559fffd0ec7029daaf60f03712cdb1df41ca8629fe8429f0a7a607
SpringBootApplication.java
contains the following
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurer() {
#Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowedMethods("GET", "PUT", "POST", "PATCH", "DELETE", "OPTIONS");
}
};
Heroku Log
2022-03-25T13:35:51.002170+00:00 heroku[web.1]: State changed from crashed to starting
2022-03-25T13:35:54.059594+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=13204 $JAVA_OPTS -jar target/budget-backend-postsql-0.0.1-SNAPSHOT.jar`
2022-03-25T13:35:54.935490+00:00 app[web.1]: Create a Procfile to customize the command used to run this process: https://devcenter.heroku.com/articles/procfile
2022-03-25T13:35:54.959996+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2022-03-25T13:35:54.964400+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2022-03-25T13:35:55.118429+00:00 app[web.1]: no main manifest attribute, in target/budget-backend-postsql-0.0.1-SNAPSHOT.jar
2022-03-25T13:35:55.259986+00:00 heroku[web.1]: Process exited with status 1
2022-03-25T13:35:55.302308+00:00 heroku[web.1]: State changed from starting to crashed
2022-03-25T15:25:55.884892+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=budget-program-backend.herokuapp.com request_id=69a08cfa-7635-4586-8454-5f91b4ccca8e fwd="35.136.227.81" dyno= connect= service= status=503 bytes= protocol=https
2022-03-25T15:25:56.285150+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=budget-program-backend.herokuapp.com request_id=4ad6b14b-ee7b-4dd0-9cee-ea9d7ef547a7 fwd="35.136.227.81" dyno= connect= service= status=503 bytes= protocol=https
Fixed some of the above in POM.XML
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.places.Main</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
New error:
2022-03-25T16:38:26.078846+00:00 heroku[web.1]: Process exited with status 1
2022-03-25T16:38:26.138596+00:00 heroku[web.1]: State changed from starting to crashed
2022-03-25T16:44:21.027515+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=budget-program-backend.herokuapp.com request_id=1b4650a2-c5f4-4fb6-8300-79e7309bc9fe fwd="35.136.227.81" dyno= connect= service= status=503 bytes= protocol=https
2022-03-25T16:44:21.202166+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=budget-program-backend.herokuapp.com request_id=593e9080-71e8-4e0a-9308-8ca4ff6107d2 fwd="35.136.227.81" dyno= connect= service= status=503 bytes= protocol=https
First, u can check Heroku logs on your backend application there should be an exception if the spring boot application can't access the Postgres server. If there is an exception related to accessing the SQL server you should check the JDBC connection string. I think you are missing "jdbc:" in your data source URL
"spring.datasource.url=postgres://xmmazemfflgbkj:a323bc337c559fffd0ec7029daaf60f03712cdb1df41ca8629fe8429f0a7a607#ec2-54-85-113-73.compute-1.amazonaws.com:5432/d423nfcf5dbjf7".Also you should try to test remote spring boot applications APIs with the postman durring the testing to avoid CORS issue.One more advice do not share real SQL credentional on any public website.
I'm writing a simple client/server app and getting into an issue when deploying to Heroku. My code is here (currently at commit 11351f8e15a872e50595ad305eb4a935bba3a0d6) and I based it on this and this tutorial (both suggest the same directoy structure, just differ in the main package.json scripts).
At first, I got an error cannot access '/app/build/static/js/*.js', which I resolved by running this command (which neither of the tutorials mentioned :-/).
heroku config:set JS_RUNTIME_TARGET_BUNDLE=/app/client/build/js/*.js
I thought I was good, but no. Despite Heroku no longer complains, there is simply nothing out there, just 404. I bet it's something trivial, but I'm honestly running out of ideas. Please help.
2020-05-05T15:11:49.896205+00:00 app[api]: Set JS_RUNTIME_TARGET_BUNDLE config vars by user [...]
2020-05-05T15:11:49.896205+00:00 app[api]: Release v19 created by user [...]
2020-05-05T15:11:51.492041+00:00 app[web.1]: Going down, terminating child processes...
2020-05-05T15:12:00.850825+00:00 app[web.1]: Injecting runtime env into /app/client/build/static/js/2.e0399e74.chunk.js (from .profile.d/inject_react_app_env.sh)
2020-05-05T15:12:00.949574+00:00 app[web.1]: Injecting runtime env into /app/client/build/static/js/main.e25999d1.chunk.js (from .profile.d/inject_react_app_env.sh)
2020-05-05T15:12:01.041037+00:00 app[web.1]: Injecting runtime env into /app/client/build/static/js/runtime-main.b186b88b.js (from .profile.d/inject_react_app_env.sh)
2020-05-05T15:12:01.368403+00:00 app[web.1]: Starting log redirection...
2020-05-05T15:12:01.368798+00:00 app[web.1]: Starting nginx...
2020-05-05T15:12:01.632649+00:00 heroku[web.1]: State changed from starting to up
2020-05-05T15:12:16.518752+00:00 heroku[run.5999]: State changed from up to complete
2020-05-05T15:12:32.064267+00:00 heroku[router]: at=info method=GET path="/" host=bn-go.herokuapp.com request_id=8e4f6060-26e2-4283-8637-c79f09e61778 fwd="106.72.42.32" dyno=web.1 connect=1ms service=3ms status=404 bytes=403 protocol=https
2020-05-05T15:29:07.968532+00:00 heroku[router]: at=info method=GET path="/api/load" host=bn-go.herokuapp.com request_id=b1942d65-eac0-4873-ba4b-b07a41efe2b1 fwd="106.72.42.32" dyno=web.1 connect=0ms service=2ms status=404 bytes=403 protocol=https
Ugh, I figured it out. It was create-react-app-buildpack, which changed dyno setting from "npm start" to "bin/boot". I removed it and it all works fine.
I built a php based website on the cloud9(C9) ide and I have a database based in heroku. The database works and information is retrieved when running it on my cloud (All tables requested in code appear where they should be). But when I push all my code to Heroku to the same application hosting the database, it fails to retrieve the information, no error codes shown, just a blank portion of the page. All Heroku credentials are correct because cloud9 can still pull from Heroku and I can physically see my database loaded on MySql Workbench on the Heroku server, so it is there.
When ran in the development environment cloud9 provides my code was pulling data out the clearDB database just fine, but when this code is pushed to Heroku and ran in Heroku, I receive a different result. The website design is there, but when I press the management tab there are not items from the ClearDB database present. Below you will see images of the differences between the code being ran in cloud9 and heroku.
Application logs
2018-05-28T07:52:36.460199+00:00 heroku[router]: at=info method=GET path="/CoffeeOverview.php" host=serene-shelf-61592.herokuapp.com request_id=80ec77fc-9fdd-4ffb-a325-955a41a85493 fwd="198.189.249.57" dyno=web.1 connect=0ms service=4ms status=500 bytes=530 protocol=https
2018-05-28T07:52:36.459705+00:00 app[web.1]: [28-May-2018 07:52:36 UTC] PHP Fatal error: Call to undefined function mysql_connect() in /app/Model/CoffeeModel.php on line 30
2018-05-28T07:52:36.460137+00:00 app[web.1]: 10.111.216.133 - - [28/May/2018:07:52:36 +0000] "GET /CoffeeOverview.php HTTP/1.1" 500 340 "https://serene-shelf-61592.herokuapp.com/Management.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
2018-05-28T08:19:47.074063+00:00 heroku[router]: at=info method=GET path="/Management.php" host=serene-shelf-61592.herokuapp.com request_id=91a804d7-81f2-4fed-b3da-d922e2438cee fwd="185.20.6.84" dyno=web.1 connect=0ms service=4ms status=200 bytes=1472 protocol=http
2018-05-28T08:19:47.074422+00:00 app[web.1]: 10.41.164.211 - - [28/May/2018:08:19:47 +0000] "GET /Management.php HTTP/1.1" 200 1301 "-" "Mozilla/5.0 (TweetmemeBot/4.0; +http://datasift.com/bot.html) Gecko/20100101 Firefox/31.0
2018-05-28T08:56:00.991844+00:00 heroku[web.1]: Idling
2018-05-28T08:56:00.993076+00:00 heroku[web.1]: State changed from up to down
2018-05-28T08:56:01.900896+00:00 app[web.1]: Going down, terminating child processes...
2018-05-28T08:56:01.883618+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-05-28T08:56:01.993121+00:00 heroku[web.1]: Process exited with status 143
Autoscroll with output Save
heroku.com Blogs Careers Documentation
My /register is working perfectly on localhost but giving me a 503 error on heroku. Here's the error message.
Failed to load resource: the server responded with a status of 503 (Service Unavailable)
Here's the next message that appears below it (not sure if it's important or just shows that the app is breaking)
Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: error in registerError, Duplicate key: string: , Duplicate value: " "
And finally here's my heroku logs
2015-12-02T13:44:53.965876+00:00 heroku[router]: at=info method=GET path="/modules/aggregated.css" host=www.fillinfor.me request_id=54d7e7b0-037e-4147-a55b-4d66a838b2d8 fwd="69.23.66.60" dyno=web.1 connect=0ms service=3ms status=304 bytes=127
2015-12-02T13:45:00.776609+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/register" host=www.fillinfor.me request_id=359d5d68-a083-4349-b4f6-c0198259d0e3 fwd="69.23.66.60" dyno=web.1 connect=0ms service=30001ms status=503 bytes=0
Update:
Here's the registration page url http://www.fillinfor.me/?#!/join
here it is on localhost http://localhost:3000/?#!/join