Everything works fine until I push to heroku, I gathered that it has to do with diffirent ways mysql and postgres display the boolean values?
I am using Ruby 1.9.2p318 and Rails 3.2.2 with Mysql 5.2.35 on Max OSX
Here is the query I am trying to run
#special_offers = Wine.find(:all, :include => [:inventories], :conditions => ["inventories.special = ? AND inventories.warehouse_id IN (?)", "true", #wharehouses_array], :order => "inventories.updated_at DESC", :limit => 3)
It seems the problem lies with the inventories.special = ?, "true"
This works fine on mysql but not when I push to heroku, wich is using postgres
I have tried replacing the "true" with 1 and "1" and "t" and t and true but nothing seems to work?
UPDATE:
Heroku log file
2012-04-04T14:06:58+00:00 app[web.1]: [2012-04-04 14:06:58] INFO WEBrick 1.3.1
2012-04-04T14:06:58+00:00 app[web.1]: [2012-04-04 14:06:58] INFO WEBrick::HTTPServer#start: pid=1 port=54181
2012-04-04T14:06:58+00:00 app[web.1]: [2012-04-04 14:06:58] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2012-04-04T14:06:59+00:00 heroku[web.1]: State changed from starting to up
2012-04-04T14:07:01+00:00 app[web.1]: => Booting WEBrick
2012-04-04T14:07:01+00:00 app[web.1]: => Call with -d to detach
2012-04-04T14:07:01+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-04-04T14:07:01+00:00 app[web.1]:
2012-04-04T14:07:01+00:00 app[web.1]: => Rails 3.2.2 application starting in production on http://0.0.0.0:54181
2012-04-04T14:07:01+00:00 app[web.1]:
2012-04-04T14:07:01+00:00 app[web.1]: Started GET "/" for 41.119.121.138 at 2012-04-04 14:07:01 +0000
2012-04-04T14:07:02+00:00 app[web.1]: Processing by HomeController#index as HTML
2012-04-04T14:07:03+00:00 app[web.1]: Rendered partials/_display_wines.html.erb (169.1ms)
2012-04-04T14:07:03+00:00 app[web.1]: Rendered partials/_display_wines.html.erb (0.0ms)
2012-04-04T14:07:03+00:00 app[web.1]: Rendered partials/_display_wines.html.erb (8.1ms)
2012-04-04T14:07:03+00:00 app[web.1]: Rendered home/index.html.erb within layouts/application (259.9ms)
2012-04-04T14:07:03+00:00 app[web.1]: Rendered partials/_header_bar.html.erb (6.5ms)
2012-04-04T14:07:03+00:00 app[web.1]: Rendered partials/_main_links.html.erb (0.3ms)
2012-04-04T14:07:03+00:00 app[web.1]: Rendered partials/_footer.html.erb (4.9ms)
2012-04-04T14:07:03+00:00 app[web.1]: Completed 200 OK in 1081ms (Views: 345.8ms | ActiveRecord: 175.7ms | Solr: 0.0ms)
2012-04-04T14:07:03+00:00 app[web.1]: cache: [GET /] miss
2012-04-04T14:07:03+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=1350ms status=200 bytes=36808
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/javascripts/jquery.js dyno=web.1 queue=0 wait=0ms service=137ms status=304 bytes=0
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/stylesheets/style1.css dyno=web.1 queue=0 wait=0ms service=179ms status=304 bytes=0
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /stylesheets/style1.css] miss
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /javascripts/jquery.js] miss
+00:00 app[web.1]: cache: [GET /javascripts/script1.js] miss
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/javascripts/script1.js dyno=web.1 queue=0 wait=0ms service=187ms status=304 bytes=0
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/javascripts/PIE.js dyno=web.1 queue=0 wait=0ms service=185ms status=304 bytes=0
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/javascripts/rails.js dyno=web.1 queue=0 wait=0ms service=189ms status=304 bytes=0
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /javascripts/PIE.js] miss
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /javascripts/rails.js] miss
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /images/header_tile.png] miss
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/header_tile.png dyno=web.1 queue=0 wait=0ms service=16ms status=304 bytes=0
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /images/none.png] miss
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/none.png dyno=web.1 queue=0 wait=0ms service=35ms status=304 bytes=0
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /images/cybercellar_logo.jpg] miss
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /images/flags.png] miss
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/flags.png dyno=web.1 queue=0 wait=0ms service=96ms status=304 bytes=0
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/cybercellar_logo.jpg dyno=web.1 queue=0 wait=0ms service=84ms status=304 bytes=0
2012-04-04T14:07:04+00:00 app[web.1]: cache: [GET /images/header_login.png] miss
2012-04-04T14:07:04+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/header_login.png dyno=web.1 queue=0 wait=0ms service=44ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/no_wine.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/no_wine.png dyno=web.1 queue=0 wait=0ms service=22ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/buttons2.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/buttons2.png dyno=web.1 queue=0 wait=0ms service=19ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/find_wine_wrap.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/find_wine_wrap.png dyno=web.1 queue=0 wait=0ms service=22ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/comment.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/comment.png dyno=web.1 queue=0 wait=0ms service=5ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/bullet.png] miss
4:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/bullet.png dyno=web.1 queue=0 wait=0ms service=13ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/buttons.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/buttons.png dyno=web.1 queue=0 wait=0ms service=12ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/links_bar.png] miss
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/hr_light.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/hr_light.png dyno=web.1 queue=0 wait=0ms service=12ms status=304 bytes=0
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/links_bar.png dyno=web.1 queue=0 wait=0ms service=17ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/cart_background.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/cart_background.png dyno=web.1 queue=0 wait=0ms service=4ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/home_page_image.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/home_page_image.png dyno=web.1 queue=0 wait=0ms service=6ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/find_wine.png] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/find_wine.png dyno=web.1 queue=0 wait=0ms service=10ms status=304 bytes=0
2012-04-04T14:07:05+00:00 app[web.1]: cache: [GET /images/footer_tile.jpg] miss
2012-04-04T14:07:05+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/footer_tile.jpg dyno=web.1 queue=0 wait=0ms service=7ms status=304 bytes=0
2012-04-04T14:07:06+00:00 app[web.1]: cache: [GET /images/social.png] miss
2012-04-04T14:07:06+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/hr_dark.jpg dyno=web.1 queue=0 wait=0ms service=5ms status=304 bytes=0
2012-04-04T14:07:06+00:00 app[web.1]: cache: [GET /images/hr_dark.jpg] miss
2012-04-04T14:07:06+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/social.png dyno=web.1 queue=0 wait=0ms service=6ms status=304 bytes=0
2012-04-04T14:07:06+00:00 app[web.1]: cache: [GET /images/credit_cards.png] miss
2012-04-04T14:07:06+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/credit_cards.png dyno=web.1 queue=0 wait=0ms service=14ms status=304 bytes=0
2012-04-04T14:07:06+00:00 app[web.1]: cache: [GET /images/money_back.png] miss
2012-04-04T14:07:06+00:00 heroku[router]: GET stormy-fog-6888.herokuapp.com/images/money_back.png dyno=web.1 queue=0 wait=0ms service=5ms status=304 bytes=0
Schema file: for the inventories table
create_table "inventories", :force => true do |t|
t.integer "wine_id"
t.integer "warehouse_id"
t.integer "stock"
t.float "price"
t.integer "quantity_id"
t.timestamp "created_at"
t.timestamp "updated_at"
t.boolean "available", :default => false
t.boolean "discount", :default => false
t.string "markupprofile_id", :limit => 45
t.string "discountprofile_id", :limit => 45
t.float "discount_price"
t.boolean "special", :default => false
end
Use the actual TrueClass, not a string, and Rails will translate it into the correct query for you.
Correct:
"inventories.special = ?", true
Incorrect:
"inventories.special = ?", "true"
It's not throwing an error because the second one still produces a valid query, it's just looking for records where special is a string with the actual t-r-u-e characters in it.
Related
2023-01-27T20:52:07.617166+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=protected-hamlet-02351.herokuapp.com request_id=14e2b1ae-7a5b-43aa-8944-a5d406fb5727 fwd="42.105.234.220"
dyno= connect= service= status=503 bytes= protocol=https
can you guys please resolve this issue
Everything works fine, able to deploy the application on the server but the problem is on the website. It shows the content without CSS styles
Website link: https://riorana95.herokuapp.com/
On localhost it's working fine. It should look like this:
Here is my log from Heroku using the command heroku logs --tail.
2020-07-23T17:48:24.825819+00:00 app[web.1]: 10.143.53.219 - - [23/Jul/2020:17:48:24 +0000] "GET /about_Rio/ HTTP/1.1" 200 882 "http://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T17:48:24.827513+00:00 heroku[router]: at=info method=GET path="/about_Rio/" host=riorana95.herokuapp.com request_id=4896513b-fe03-43a6-a92e-b001947a1d71 fwd="150.107.10.58" dyno=web.1 connect=1ms service=3ms status=200 bytes=1043 protocol=http
2020-07-23T17:48:25.120451+00:00 app[web.1]: 10.143.53.219 - - [23/Jul/2020:17:48:25 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "http://riorana95.herokuapp.com/about_Rio/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T17:48:25.122106+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=f70e3d89-e0c6-4dd1-a3c6-e29830608b7d fwd="150.107.10.58" dyno=web.1 connect=4ms service=2ms status=404 bytes=400 protocol=http
2020-07-23T18:23:11.234512+00:00 heroku[web.1]: Idling
2020-07-23T18:23:11.236726+00:00 heroku[web.1]: State changed from up to down
2020-07-23T18:23:12.219251+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-07-23T18:23:12.253388+00:00 app[web.1]: [2020-07-23 18:23:12 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-07-23T18:23:12.253413+00:00 app[web.1]: [2020-07-23 18:23:12 +0000] [4] [INFO] Handling signal: term
2020-07-23T18:23:12.253414+00:00 app[web.1]: [2020-07-23 18:23:12 +0000] [9] [INFO] Worker exiting (pid: 9)
2020-07-23T18:23:12.351871+00:00 app[web.1]: [2020-07-23 18:23:12 +0000] [4] [INFO] Shutting down: Master
2020-07-23T18:23:12.438076+00:00 heroku[web.1]: Process exited with status 0
2020-07-23T18:23:26.376869+00:00 heroku[web.1]: Unidling
2020-07-23T18:23:26.378668+00:00 heroku[web.1]: State changed from down to starting
2020-07-23T18:23:30.025938+00:00 heroku[web.1]: Starting process with command `gunicorn Website_using_Flask:app`
2020-07-23T18:23:32.164756+00:00 app[web.1]: [2020-07-23 18:23:32 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-07-23T18:23:32.165285+00:00 app[web.1]: [2020-07-23 18:23:32 +0000] [4] [INFO] Listening at: http://0.0.0.0:50359 (4)
2020-07-23T18:23:32.165370+00:00 app[web.1]: [2020-07-23 18:23:32 +0000] [4] [INFO] Using worker: sync
2020-07-23T18:23:32.168764+00:00 app[web.1]: [2020-07-23 18:23:32 +0000] [9] [INFO] Booting worker with pid: 9
2020-07-23T18:23:32.266645+00:00 app[web.1]: [2020-07-23 18:23:32 +0000] [10] [INFO] Booting worker with pid: 10
2020-07-23T18:24:41.561982+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=riorana95.herokuapp.com request_id=4d6522a9-eb49-48de-838e-d51b04f5298a fwd="150.107.10.58" dyno= connect= service= status=503 bytes= protocol=http
2020-07-23T18:25:10.484012+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=riorana95.herokuapp.com request_id=84e5b587-3a19-42f7-a839-18c52fc8eb7c fwd="150.107.10.58" dyno= connect= service= status=503 bytes= protocol=http
2020-07-23T18:25:11.936294+00:00 heroku[web.1]: State changed from starting to up
2020-07-23T18:25:13.278599+00:00 app[web.1]: 10.63.41.14 - - [23/Jul/2020:18:25:13 +0000] "GET / HTTP/1.1" 200 707 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:13.285136+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=504ebb43-4e09-43f2-a3a1-86152c63649a fwd="150.107.10.58" dyno=web.1 connect=7ms service=20ms status=200 bytes=868 protocol=http
2020-07-23T18:25:13.345050+00:00 app[web.1]: 10.168.89.215 - - [23/Jul/2020:18:25:13 +0000] "GET / HTTP/1.1" 200 707 "https://dashboard.heroku.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:13.346251+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=a60d391a-6003-47b1-864e-6a4226bf6793 fwd="150.107.10.58" dyno=web.1 connect=2ms service=3ms status=200 bytes=868 protocol=https
2020-07-23T18:25:13.607685+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=14b84dab-ed49-4717-8bb8-13c0da850a7e fwd="150.107.10.58" dyno=web.1 connect=1ms service=3ms status=404 bytes=400 protocol=http
2020-07-23T18:25:13.608849+00:00 app[web.1]: 10.63.41.14 - - [23/Jul/2020:18:25:13 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "http://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:13.630266+00:00 app[web.1]: 10.168.89.215 - - [23/Jul/2020:18:25:13 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "https://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:13.631668+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=87cdf239-1ef3-4948-8251-ec40864570a1 fwd="150.107.10.58" dyno=web.1 connect=0ms service=3ms status=404 bytes=400 protocol=https
2020-07-23T18:25:13.962079+00:00 app[web.1]: 10.93.223.38 - - [23/Jul/2020:18:25:13 +0000] "GET / HTTP/1.1" 200 707 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:13.964554+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=a8ddf48a-1f8b-4f9e-8205-af48d1c5a990 fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=200 bytes=868 protocol=https
2020-07-23T18:25:18.042259+00:00 app[web.1]: 10.35.254.221 - - [23/Jul/2020:18:25:18 +0000] "GET /about_Rio/ HTTP/1.1" 200 882 "http://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:18.043411+00:00 heroku[router]: at=info method=GET path="/about_Rio/" host=riorana95.herokuapp.com request_id=cb0d2e0f-63d2-4f5f-b38f-66f1734cd98d fwd="150.107.10.58" dyno=web.1 connect=1ms service=5ms status=200 bytes=1043 protocol=http
2020-07-23T18:25:18.328184+00:00 app[web.1]: 10.35.254.221 - - [23/Jul/2020:18:25:18 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "http://riorana95.herokuapp.com/about_Rio/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:18.329422+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=1b0329e1-39ba-49e4-93a0-e91b555c876e fwd="150.107.10.58" dyno=web.1 connect=1ms service=2ms status=404 bytes=400 protocol=http
2020-07-23T18:25:20.699983+00:00 app[web.1]: 10.35.254.221 - - [23/Jul/2020:18:25:20 +0000] "GET / HTTP/1.1" 200 707 "http://riorana95.herokuapp.com/about_Rio/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:20.701477+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=1ec0a8a5-e2b3-4767-bb8b-24e92cdef2a7 fwd="150.107.10.58" dyno=web.1 connect=0ms service=21ms status=200 bytes=868 protocol=http
2020-07-23T18:25:20.984356+00:00 app[web.1]: 10.35.254.221 - - [23/Jul/2020:18:25:20 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "http://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:20.985628+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=6742ee51-f34b-47fd-9775-2e2215546249 fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=404 bytes=400 protocol=http
2020-07-23T18:25:22.816648+00:00 heroku[router]: at=info method=GET path="/about_Rio/" host=riorana95.herokuapp.com request_id=66e12c99-eb21-4ff4-9d6f-13ee9a7ed8b5 fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=200 bytes=1043 protocol=http
2020-07-23T18:25:22.817304+00:00 app[web.1]: 10.35.254.221 - - [23/Jul/2020:18:25:22 +0000] "GET /about_Rio/ HTTP/1.1" 200 882 "http://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:23.107992+00:00 app[web.1]: 10.35.254.221 - - [23/Jul/2020:18:25:23 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "http://riorana95.herokuapp.com/about_Rio/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:23.109072+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=5d0434fb-ea55-4c4b-9510-e8c0e77d152b fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=404 bytes=400 protocol=http
2020-07-23T18:25:25.583074+00:00 app[web.1]: 10.35.254.221 - - [23/Jul/2020:18:25:25 +0000] "GET / HTTP/1.1" 200 707 "http://riorana95.herokuapp.com/about_Rio/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:25.584169+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=25a5fe75-a45e-4ccf-843f-a07bebea1100 fwd="150.107.10.58" dyno=web.1 connect=1ms service=2ms status=200 bytes=868 protocol=http
2020-07-23T18:25:25.875038+00:00 app[web.1]: 10.35.254.221 - - [23/Jul/2020:18:25:25 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "http://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:25.876297+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=b06f982f-a952-4fd1-9edb-39ed437a0bf2 fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=404 bytes=400 protocol=http
2020-07-23T18:25:29.179954+00:00 app[web.1]: 10.168.89.215 - - [23/Jul/2020:18:25:29 +0000] "GET /about_Rio/ HTTP/1.1" 200 882 "https://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:29.181088+00:00 heroku[router]: at=info method=GET path="/about_Rio/" host=riorana95.herokuapp.com request_id=84d486d8-129f-4142-b654-683560c4e149 fwd="150.107.10.58" dyno=web.1 connect=1ms service=2ms status=200 bytes=1043 protocol=https
2020-07-23T18:25:29.461655+00:00 app[web.1]: 10.168.89.215 - - [23/Jul/2020:18:25:29 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "https://riorana95.herokuapp.com/about_Rio/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:29.462679+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=4019903e-d2ef-4daa-8538-09d0104684c4 fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=404 bytes=400 protocol=https
2020-07-23T18:25:30.253891+00:00 app[web.1]: 10.168.89.215 - - [23/Jul/2020:18:25:30 +0000] "GET / HTTP/1.1" 200 707 "https://riorana95.herokuapp.com/about_Rio/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:30.259322+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=353fc7a6-918e-432b-9057-8630a1a79940 fwd="150.107.10.58" dyno=web.1 connect=1ms service=6ms status=200 bytes=868 protocol=https
2020-07-23T18:25:30.539953+00:00 app[web.1]: 10.168.89.215 - - [23/Jul/2020:18:25:30 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "https://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:30.541893+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=fba748ae-7f7a-4086-9add-09dcfafadfea fwd="150.107.10.58" dyno=web.1 connect=0ms service=3ms status=404 bytes=400 protocol=https
2020-07-23T18:25:38.438155+00:00 app[web.1]: 10.47.238.174 - - [23/Jul/2020:18:25:38 +0000] "GET /about_Rio/ HTTP/1.1" 200 882 "http://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:38.440174+00:00 heroku[router]: at=info method=GET path="/about_Rio/" host=riorana95.herokuapp.com request_id=38208553-39dc-4f43-b633-2f88d185db06 fwd="150.107.10.58" dyno=web.1 connect=1ms service=4ms status=200 bytes=1043 protocol=http
2020-07-23T18:25:38.746501+00:00 app[web.1]: 10.47.238.174 - - [23/Jul/2020:18:25:38 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "http://riorana95.herokuapp.com/about_Rio/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:25:38.748666+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=9b0a751c-aa94-4acc-8a0c-291ca3bd76b2 fwd="150.107.10.58" dyno=web.1 connect=1ms service=3ms status=404 bytes=400 protocol=http
2020-07-23T18:59:49.123507+00:00 app[web.1]: 10.123.249.13 - - [23/Jul/2020:18:59:49 +0000] "GET / HTTP/1.1" 200 707 "https://dashboard.heroku.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:59:49.128334+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=b35d8ea9-67c2-4d20-9596-9ea7645006d2 fwd="150.107.10.58" dyno=web.1 connect=1ms service=7ms status=200 bytes=868 protocol=https
2020-07-23T18:59:49.413523+00:00 app[web.1]: 10.123.249.13 - - [23/Jul/2020:18:59:49 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "https://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-23T18:59:49.415132+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=e06e61a7-e902-4ef6-9b7e-a76c5ea10ec0 fwd="150.107.10.58" dyno=web.1 connect=1ms service=3ms status=404 bytes=400 protocol=https
2020-07-23T19:31:12.243100+00:00 heroku[web.1]: Idling
2020-07-23T19:31:12.246818+00:00 heroku[web.1]: State changed from up to down
2020-07-23T19:31:13.399725+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-07-23T19:31:13.439108+00:00 app[web.1]: [2020-07-23 19:31:13 +0000] [4] [INFO] Handling signal: term
2020-07-23T19:31:13.444182+00:00 app[web.1]: [2020-07-23 19:31:13 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-07-23T19:31:13.444188+00:00 app[web.1]: [2020-07-23 19:31:13 +0000] [9] [INFO] Worker exiting (pid: 9)
2020-07-23T19:31:13.540022+00:00 app[web.1]: [2020-07-23 19:31:13 +0000] [4] [INFO] Shutting down: Master
2020-07-23T19:31:13.776701+00:00 heroku[web.1]: Process exited with status 0
2020-07-24T02:46:49.242630+00:00 heroku[web.1]: Unidling
2020-07-24T02:46:49.269496+00:00 heroku[web.1]: State changed from down to starting
2020-07-24T02:46:52.708726+00:00 heroku[web.1]: Starting process with command `gunicorn Website_using_Flask:app`
2020-07-24T02:46:54.822177+00:00 app[web.1]: [2020-07-24 02:46:54 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-07-24T02:46:54.822799+00:00 app[web.1]: [2020-07-24 02:46:54 +0000] [4] [INFO] Listening at: http://0.0.0.0:19235 (4)
2020-07-24T02:46:54.822907+00:00 app[web.1]: [2020-07-24 02:46:54 +0000] [4] [INFO] Using worker: sync
2020-07-24T02:46:54.826995+00:00 app[web.1]: [2020-07-24 02:46:54 +0000] [9] [INFO] Booting worker with pid: 9
2020-07-24T02:46:54.876439+00:00 app[web.1]: [2020-07-24 02:46:54 +0000] [10] [INFO] Booting worker with pid: 10
2020-07-24T02:46:54.991972+00:00 heroku[web.1]: State changed from starting to up
2020-07-24T02:46:56.326724+00:00 app[web.1]: 10.35.221.122 - - [24/Jul/2020:02:46:56 +0000] "GET / HTTP/1.1" 200 707 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-24T02:46:56.328923+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=a93dff84-09a9-4458-90ab-4ef075892499 fwd="150.107.10.58" dyno=web.1 connect=0ms service=12ms status=200 bytes=868 protocol=https
2020-07-24T02:46:56.614391+00:00 app[web.1]: 10.35.221.122 - - [24/Jul/2020:02:46:56 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "https://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-24T02:46:56.616186+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=e8f43237-627f-4bc0-a973-8183fc564264 fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=404 bytes=400 protocol=https
2020-07-24T02:46:56.906159+00:00 app[web.1]: 10.35.221.122 - - [24/Jul/2020:02:46:56 +0000] "GET /favicon.ico HTTP/1.1" 404 232 "https://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-24T02:46:56.908001+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=riorana95.herokuapp.com request_id=808494d1-8691-43c9-ad3a-a811c4aaafe1 fwd="150.107.10.58" dyno=web.1 connect=0ms service=1ms status=404 bytes=400 protocol=https
2020-07-24T02:49:29.435757+00:00 app[web.1]: 10.41.192.172 - - [24/Jul/2020:02:49:29 +0000] "GET / HTTP/1.1" 200 707 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-24T02:49:29.438155+00:00 heroku[router]: at=info method=GET path="/" host=riorana95.herokuapp.com request_id=0eeeb9b7-6ffb-4ec0-854e-66d988823b12 fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=200 bytes=868 protocol=https
2020-07-24T02:49:29.771077+00:00 app[web.1]: 10.41.192.172 - - [24/Jul/2020:02:49:29 +0000] "GET /static/css/main.css HTTP/1.1" 404 232 "https://riorana95.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
2020-07-24T02:49:29.773535+00:00 heroku[router]: at=info method=GET path="/static/css/main.css" host=riorana95.herokuapp.com request_id=aeaf3464-386b-4375-b17e-7e75a6416c43 fwd="150.107.10.58" dyno=web.1 connect=0ms service=2ms status=404 bytes=400 protocol=https
2020-07-24T03:24:25.677289+00:00 heroku[web.1]: Idling
2020-07-24T03:24:25.679382+00:00 heroku[web.1]: State changed from up to down
2020-07-24T03:24:28.348363+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-07-24T03:24:28.397955+00:00 app[web.1]: [2020-07-24 03:24:28 +0000] [9] [INFO] Worker exiting (pid: 9)
2020-07-24T03:24:28.402535+00:00 app[web.1]: [2020-07-24 03:24:28 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-07-24T03:24:28.419073+00:00 app[web.1]: [2020-07-24 03:24:28 +0000] [4] [INFO] Handling signal: term
2020-07-24T03:24:28.520067+00:00 app[web.1]: [2020-07-24 03:24:28 +0000] [4] [INFO] Shutting down: Master
2020-07-24T03:24:28.609430+00:00 heroku[web.1]: Process exited with status 0
My Python code:
from flask import Flask, render_template
app = Flask(__name__)
#app.route('/')
def home():
return render_template("Journey.html")
#app.route('/about_Rio/')
def about():
return render_template("About Rio.html")
if __name__ == "__main__":
app.run(debug=True)
HTML file layout_2 code:
<!DOCTYPE html>
<html>
<head>
<title>Flask App</title>
<link rel="stylesheet" href="{{url_for('static',filename='css/main.css')}}">
</head>
<body>
<header>
<div class="container">
<h1 class="logo">Web App</h1>
<strong><nav>
<ul class="menu">
<li>Home</li>
<li>About</li>
</ul>
</nav></strong>
</header><div class="container">
{%block content%}
{%endblock%}
</div>
</body>
</html>
HTML file Journey code:
{%extends "layout_2.html"%}
{%block content%}
<div class="home">
<h1>Journey</h1>
<p>About people</p>
</div>
{%endblock%}
HTML file About Rio code:
{%extends "layout_2.html"%}
{%block content%}
<div class="about">
<h1>
<center>About Rio</center>
</h1>
<ul>
<li>22-07-2020 :- The longer you live… The more you realize that reality is just made of pain, suffering and
emptiness</li>
</ul>
</div>
{%endblock%}
CSS file code:
body {
margin: 0;
padding: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #060;
}
/*
* Formatting the header area
*/
header {
background-color: #DFB887;
height: 35px;
width: 100%;
opacity: .9;
margin-bottom: 10px;
}
header h1.logo {
margin: 0;
font-size: 1.7em;
color: #fff;
text-transform: uppercase;
float: left;
}
header h1.logo:hover {
color: #fff;
text-decoration: none;
}
/*
* Center the body content
*/
.container {
width: 1200px;
margin: 0 auto;
}
div.home {
padding: 10px 0 30px 0;
background-color: #E6E6FA;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
div.about {
padding: 10px 0 30px 0;
background-color: #E6E6FA;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
h2 {
font-size: 3em;
margin-top: 40px;
text-align: center;
letter-spacing: -2px;
}
h3 {
font-size: 1.7em;
font-weight: 100;
margin-top: 30px;
text-align: center;
letter-spacing: -1px;
color: #999;
}
.menu {
float: right;
margin-top: 8px;
}
.menu li {
display: inline;
}
.menu li + li {
margin-left: 35px;
}
.menu li a {
color: #444;
text-decoration: none;
}
I don't know exactly where was the problem but it working now.
I deleted the app from heroku and .git folder from my "website" folder and change folder name from CSS to css (inside static folder).
then i retry all the process and now it's working fine
I am trying for the first time to use Heroku, my app works fine on the local machine, and it builds successfully on Heroku but when I try to open it I get the following errors, full logs at the end
2020-05-02T16:35:34.660563+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-02T16:35:42.610766+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=d3ccbec7-c4a3-4805-8df5-ea8f39b82001 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-02T16:35:43.084078+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=09e01082-777c-4b95-a556-c2b85d9fe192 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
here is the index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:image" content="http://euro-travel-example.com/thumbnail.jpg">
<meta property="og:url" content="http://euro-travel-example.com/index.htm">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<title>testapp</title>
</head>
<body>
<div id="root"></div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"
integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"
integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm"
crossorigin="anonymous"></script>
</body>
</html>
2020-05-05T18:49:55.957210+00:00 app[web.1]:
2020-05-05T18:49:57.832175+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.16.247.6/
2020-05-05T18:49:57.832502+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2020-05-05T18:49:57.832579+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2020-05-05T18:49:57.832647+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2020-05-05T18:49:57.832827+00:00 app[web.1]: Starting the development server...
2020-05-05T18:49:57.832827+00:00 app[web.1]:
2020-05-05T18:49:57.930367+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-06T00:26:51.023260+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=cc1a766f-6f8e-4c9d-a905-4db2c5a35123 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:26:51.707295+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=71e0907a-cab5-460a-baae-a8f18a4c6e3c fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:27:53.993935+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=3f8f5a51-3f4c-4772-bfd2-def72ff6ba3d fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:27:54.533509+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=17c0e361-a681-4a1b-8b91-2b11d27b0889 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:28:40.343274+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=67c5ba4b-cc2a-4bf7-a541-bc85fb5368a7 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:28:40.883375+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=e571e97a-b05a-431c-8977-515877b46794 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:29:25.465162+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=76f11081-66aa-497b-8e36-edf91db8e5af fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:29:26.011122+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=8c0ae3f4-bd5a-4b4b-b35c-0d23a62eb904 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:29:29.518382+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=bd11cc44-8174-4668-8a39-e9ad79bd13ed fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:29:29.978317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=317f7164-c003-4ea8-bd6d-bda85b7379d3 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:29:54.655340+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=57bd99b4-b000-4553-acaf-8d73266b3cc9 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:29:55.215061+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=a2d42c76-35b8-42fa-885f-de122556b825 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:30:17.301612+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=59438701-a1a8-4ce9-901a-ad7026be07a4 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:30:17.853183+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=712a931c-60ec-41c0-a1f6-02885e046ec1 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:30:53.000000+00:00 app[api]: Build started by user
2020-05-06T00:32:07.210573+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-06T00:32:06.828499+00:00 app[api]: Deploy 4df36638 by user
2020-05-06T00:32:06.828499+00:00 app[api]: Release v12 created by user
2020-05-06T00:32:14.000000+00:00 app[api]: Build succeeded
2020-05-06T00:32:21.473845+00:00 app[web.1]:
2020-05-06T00:32:21.473861+00:00 app[web.1]: > opentable#0.1.0 start /app
2020-05-06T00:32:21.473861+00:00 app[web.1]: > react-scripts start
2020-05-06T00:32:21.473862+00:00 app[web.1]:
2020-05-06T00:32:25.753013+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.18.92.170/
2020-05-06T00:32:25.753629+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2020-05-06T00:32:25.753777+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2020-05-06T00:32:25.753895+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2020-05-06T00:32:25.754229+00:00 app[web.1]: Starting the development server...
2020-05-06T00:32:25.754230+00:00 app[web.1]:
2020-05-06T00:32:25.881428+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-06T00:32:25.884338+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-06T00:32:37.154954+00:00 app[web.1]:
2020-05-06T00:32:37.154971+00:00 app[web.1]: > opentable#0.1.0 start /app
2020-05-06T00:32:37.154971+00:00 app[web.1]: > react-scripts start
2020-05-06T00:32:37.154972+00:00 app[web.1]:
2020-05-06T00:32:39.227810+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.18.49.162/
2020-05-06T00:32:39.228215+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2020-05-06T00:32:39.228315+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2020-05-06T00:32:39.228403+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2020-05-06T00:32:39.228613+00:00 app[web.1]: Starting the development server...
2020-05-06T00:32:39.228615+00:00 app[web.1]:
2020-05-06T00:32:39.350859+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-06T00:32:40.270514+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=9eb7556b-8477-448a-b054-f21bbcd43734 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:32:41.800494+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=1f677ae6-ba9b-4141-9077-cca446acb53b fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:36:38.633976+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=c8267a8d-40a4-4e85-8917-fd2cbcdb5e26 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:36:39.245883+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=f3d5af60-fcf2-4ffa-935e-731525f167a0 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:45:33.000000+00:00 app[api]: Build started by user
2020-05-06T00:46:05.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/333fe337-28b4-4897-aea2-b6e00e21658c/activity/builds/353cebff-768b-4690-b319-cfd691354e65
2020-05-06T00:49:46.000000+00:00 app[api]: Build started by user
2020-05-06T00:51:00.406504+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-06T00:51:00.150835+00:00 app[api]: Deploy e761a226 by user
2020-05-06T00:51:00.150835+00:00 app[api]: Release v13 created by user
2020-05-06T00:51:07.000000+00:00 app[api]: Build succeeded
2020-05-06T00:51:10.690011+00:00 app[web.1]:
2020-05-06T00:51:10.690025+00:00 app[web.1]: > opentable#0.1.0 start /app
2020-05-06T00:51:10.690026+00:00 app[web.1]: > react-scripts start
2020-05-06T00:51:10.690026+00:00 app[web.1]:
2020-05-06T00:51:12.685464+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.16.128.62/
2020-05-06T00:51:12.685820+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2020-05-06T00:51:12.685898+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2020-05-06T00:51:12.685967+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2020-05-06T00:51:12.686185+00:00 app[web.1]: Starting the development server...
2020-05-06T00:51:12.686188+00:00 app[web.1]:
2020-05-06T00:51:12.787345+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-06T00:51:12.790433+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-06T00:51:29.195595+00:00 app[web.1]:
2020-05-06T00:51:29.195636+00:00 app[web.1]: > opentable#0.1.0 start /app
2020-05-06T00:51:29.195636+00:00 app[web.1]: > react-scripts start
2020-05-06T00:51:29.195637+00:00 app[web.1]:
2020-05-06T00:51:34.480135+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.19.76.182/
2020-05-06T00:51:34.480852+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2020-05-06T00:51:34.481791+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2020-05-06T00:51:34.481944+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2020-05-06T00:51:34.482310+00:00 app[web.1]: Starting the development server...
2020-05-06T00:51:34.482311+00:00 app[web.1]:
2020-05-06T00:51:34.653916+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-06T00:51:49.687511+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=644090fa-2282-43eb-b6a0-3f586a877b2b fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:51:50.279212+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=41875779-e718-4c21-9cd0-a27b994ce5ff fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:52:45.417633+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-06T00:52:57.867537+00:00 app[web.1]:
2020-05-06T00:52:57.867556+00:00 app[web.1]: > opentable#0.1.0 start /app
2020-05-06T00:52:57.867556+00:00 app[web.1]: > react-scripts start
2020-05-06T00:52:57.867556+00:00 app[web.1]:
2020-05-06T00:52:59.557333+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.17.90.18/
2020-05-06T00:52:59.557673+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2020-05-06T00:52:59.557747+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2020-05-06T00:52:59.557810+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2020-05-06T00:52:59.557987+00:00 app[web.1]: Starting the development server...
2020-05-06T00:52:59.557987+00:00 app[web.1]:
2020-05-06T00:52:59.658416+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-06T00:53:42.008093+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-tundra-79939.herokuapp.com request_id=92745996-d95d-4da8-a4f1-686fcb5c63be fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
2020-05-06T00:53:42.611511+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-tundra-79939.herokuapp.com request_id=bf1eafd8-3211-4027-91a6-85bb996b9038 fwd="72.137.75.96" dyno= connect= service= status=503 bytes= protocol=https
I used to have favicon but it has been removed and new git has been pushed, but still getting the error
I fixed the issue as this was my very first ever app to in nodejs i did not know i need the server.
const express = require('express');
const favicon = require('express-favicon');
const path = require('path');
const port = process.env.PORT || 9999;
const app = express();
app.use(favicon(__dirname + '/build/favicon.ico'));
app.use(express.static(__dirname));
app.use(express.static(path.join(__dirname, 'build')));
app.get('/ping', function (req, res) {
return res.send('pong');
});
app.get('/*', function (req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.listen(port);
Create the Procfile file at the root of your project and add this content (web: npm run start:prod) then redeploy your app on heroku
This work only for NodeJS application
I am currently building a Maven Project using Spring and Vaadin. I am trying to connect the app to a MySQL database. However, when I run the application I get an error like this:
2020-05-06 22:21:49.655 WARN 26027 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.berkturkcapar.bilshare.backend.entity.Category
2020-05-06 22:21:49.657 INFO 26027 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-05-06 22:21:49.668 INFO 26027 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2020-05-06 22:21:49.671 INFO 26027 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-05-06 22:21:49.675 WARN 26027 --- [ restartedMain] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [Thread-4] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.base#13.0.1/sun.nio.ch.Net.accept(Native Method)
java.base#13.0.1/sun.nio.ch.NioSocketImpl.accept(NioSocketImpl.java:755)
java.base#13.0.1/java.net.ServerSocket.implAccept(ServerSocket.java:662)
java.base#13.0.1/java.net.ServerSocket.platformImplAccept(ServerSocket.java:628)
java.base#13.0.1/java.net.ServerSocket.implAccept(ServerSocket.java:604)
java.base#13.0.1/java.net.ServerSocket.implAccept(ServerSocket.java:561)
java.base#13.0.1/java.net.ServerSocket.accept(ServerSocket.java:518)
app//com.vaadin.flow.server.DevServerWatchDog$WatchDogServer.run(DevServerWatchDog.java:58)
java.base#13.0.1/java.lang.Thread.run(Thread.java:830)
2020-05-06 22:21:49.676 WARN 26027 --- [ restartedMain] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [webpack] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.base#13.0.1/java.io.FileInputStream.readBytes(Native Method)
java.base#13.0.1/java.io.FileInputStream.read(FileInputStream.java:273)
java.base#13.0.1/java.io.BufferedInputStream.read1(BufferedInputStream.java:283)
java.base#13.0.1/java.io.BufferedInputStream.read(BufferedInputStream.java:344)
java.base#13.0.1/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:297)
java.base#13.0.1/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
java.base#13.0.1/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
java.base#13.0.1/java.io.InputStreamReader.read(InputStreamReader.java:185)
java.base#13.0.1/java.io.BufferedReader.fill(BufferedReader.java:161)
java.base#13.0.1/java.io.BufferedReader.readLine(BufferedReader.java:326)
java.base#13.0.1/java.io.BufferedReader.readLine(BufferedReader.java:392)
app//com.vaadin.flow.server.DevModeHandler.readLinesLoop(DevModeHandler.java:458)
app//com.vaadin.flow.server.DevModeHandler.lambda$logStream$1(DevModeHandler.java:436)
app//com.vaadin.flow.server.DevModeHandler$$Lambda$666/0x0000000800f77840.run(Unknown Source)
java.base#13.0.1/java.lang.Thread.run(Thread.java:830)
2020-05-06 22:21:49.682 INFO 26027 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-05-06 22:21:49.686 ERROR 26027 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.berkturkcapar.bilshare.backend.entity.Category
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1803) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at com.berkturkcapar.bilshare.Application.main(Application.java:18) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.2.1.RELEASE.jar:2.2.1.RELEASE]
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.berkturkcapar.bilshare.backend.entity.Category
at org.hibernate.cfg.InheritanceState.determineDefaultAccessType(InheritanceState.java:266) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:211) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:781) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:254) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:230) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:273) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1214) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1245) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391) ~[spring-orm-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378) ~[spring-orm-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1862) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1799) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
... 21 common frames omitted
Process finished with exit code 0
Here is my pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.berkturkcapar.bilshare</groupId>
<artifactId>bilshare</artifactId>
<name>BilShare</name>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<vaadin.version>14.1.27</vaadin.version>
<drivers.dir>${project.basedir}/drivers</drivers.dir>
<drivers.downloader.phase>pre-integration-test</drivers.downloader.phase>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
</parent>
<repositories>
<!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
<!-- Main Maven repository -->
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<!-- Repository used by many Vaadin add-ons -->
<repository>
<id>Vaadin Directory</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<!-- Main Maven repository -->
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<!-- Replace artifactId with vaadin-core to use only free components -->
<artifactId>vaadin</artifactId>
<exclusions>
<!-- Webjars are only needed when running in Vaadin 13 compatibility mode -->
<exclusion>
<groupId>com.vaadin.webjar</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.insites</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.polymer</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.polymerelements</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.vaadin</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.webcomponents</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
<exclusions>
<!-- Excluding so that webjars are not included. -->
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.20</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.25.0-GA</version>
</dependency>
</dependencies>
<build>
<defaultGoal>spring-boot:run</defaultGoal>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- Clean build and startup time for Vaadin apps sometimes may exceed
the default Spring Boot's 30sec timeout. -->
<configuration>
<wait>500</wait>
<maxAttempts>240</maxAttempts>
</configuration>
</plugin>
<!--
Take care of synchronizing java dependencies and imports in
package.json and main.js files.
It also creates webpack.config.js if not exists yet.
-->
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-frontend</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Production mode is activated using -Pproduction -->
<id>production</id>
<properties>
<vaadin.productionMode>true</vaadin.productionMode>
</properties>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-server-production-mode</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>-Dvaadin.productionMode</jvmArguments>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>build-frontend</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>start-spring-boot</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-spring-boot</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Runs the integration tests (*IT) after the server is started -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<trimStackTrace>false</trimStackTrace>
<enableAssertions>true</enableAssertions>
<systemPropertyVariables>
<!-- Pass location of downloaded webdrivers to the tests -->
<webdriver.chrome.driver>${webdriver.chrome.driver}</webdriver.chrome.driver>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>com.lazerycode.selenium</groupId>
<artifactId>driver-binary-downloader-maven-plugin</artifactId>
<version>1.0.17</version>
<configuration>
<onlyGetDriversForHostOperatingSystem>true
</onlyGetDriversForHostOperatingSystem>
<rootStandaloneServerDirectory>
${project.basedir}/drivers/driver
</rootStandaloneServerDirectory>
<downloadedZipFileDirectory>
${project.basedir}/drivers/driver_zips
</downloadedZipFileDirectory>
<customRepositoryMap>
${project.basedir}/drivers.xml
</customRepositoryMap>
</configuration>
<executions>
<execution>
<!-- use phase "none" to skip download step -->
<phase>${drivers.downloader.phase}</phase>
<goals>
<goal>selenium</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
I could not solve this error for the last couple of days. So, I can't go on with my project. I am a beginner in Spring and Vaadin. So I am open to any suggestions. I would be grateful if you could help.
No identifier specified for entity: com.berkturkcapar.bilshare.backend.entity.Category
Category Entity class is missing ID field. Add #Id annotation to the field that uniquely identifies the Category records (this field should correspond to the primary key column of the table)
I have been successfully using C3P0 0.9.1.2 with Jetty 8.1.13.v20130916. In my Jetty server instance, using a Jetty XML configuration file, I bind a C3P0-backed DataSource to JNDI. Then my web application looks up this DataSource by name. This has always worked.
I'm currently migrating to C3P0 0.9.5-pre6 and to Jetty 9.1.0.v20131115.
Since this migration, C3P0 connection pooling doesn't work anymore. I have tried different unpooled and pooled strategies.
Since the migration, the following two unpooled binding strategies work:
<Configure id="Server" class="org.eclipse.jetty.server.Server">
....
<!-- raw mysql connection without C3P0 - THIS WORKS! -->
<New id="jdbc-myds" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/myds</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<Set name="Url">jdbc:mysql://localhost:3306/myds?useUnicode=true&characterEncoding=UTF-8</Set>
<Set name="User">user</Set>
<Set name="Password">pass</Set>
</New>
</Arg>
</New>
</Configure>
<Configure id="Server" class="org.eclipse.jetty.server.Server">
....
<!-- UNPOOLED c3p0 factory - THIS WORKS! -->
<New id="jdbc-myds" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/myds</Arg>
<Arg>
<Call class="com.mchange.v2.c3p0.DataSources" name="unpooledDataSource">
<Arg>jdbc:mysql://localhost:3306/myds?useUnicode=true&characterEncoding=UTF-8</Arg>
<Arg>user</Arg>
<Arg>pass</Arg>
</Call>
</Arg>
</New>
</Configure>
Since the migration, the following two pooled binding strategies don't work:
<Configure id="Server" class="org.eclipse.jetty.server.Server">
....
<!-- typical C3P0 pool configuration - THIS DOESN'T WORK FOR ME SINCE MIGRATION -->
<New id="jdbc-myds" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/myds</Arg>
<Arg>
<New class="com.mchange.v2.c3p0.ComboPooledDataSource">
<Set name="DriverClass">com.mysql.jdbc.Driver</Set>
<Set name="JdbcUrl">jdbc:mysql://localhost:3306/myds?useUnicode=true&characterEncoding=UTF-8</Set>
<Set name="User">user</Set>
<Set name="Password">password</Set>
</New>
</Arg>
</New>
</Configure>
<Configure id="Server" class="org.eclipse.jetty.server.Server">
....
<!-- wrapping the successfully working C3P0 unpooled DataSource in a pooled DataSource - THIS DOESN'T WORK -->
<New id="jdbc-myds" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/myds</Arg>
<Arg>
<Call class="com.mchange.v2.c3p0.DataSources" name="pooledDataSource">
<Arg>
<Call class="com.mchange.v2.c3p0.DataSources" name="unpooledDataSource">
<Arg>jdbc:mysql://localhost:3306/myds?useUnicode=true&characterEncoding=UTF-8</Arg>
<Arg>user</Arg>
<Arg>pass</Arg>
</Call>
</Arg>
</Call>
</Arg>
</New>
</Configure>
In the unsuccessful cases, when visiting the server, the server's HTTP response is a Jetty-served HTTP ERROR: 503, Service Unavailable.
Even though the server-startup logs say that the JNDI resource has been successfully registered, at the moment I am trying to access that JNDI resource by name inside my web application, it doesn't exist anymore: Calling
DataSource myds = new InitialContext().lookup("java:comp/env/jdbc/myds");
throws an InvalidClassException and a NamingException:
17:08:33.907 [main] WARN jndi -
java.io.InvalidClassException: com.mchange.v2.c3p0.WrapperConnectionPoolDataSource; local class incompatible: stream classdesc serialVersionUID = -7086951306718003710, local class serialVersionUID = 7806429541739165290
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:617) ~[na:1.7.0_45]
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622) ~[na:1.7.0_45]
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517) ~[na:1.7.0_45]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) ~[na:1.7.0_45]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_45]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) ~[na:1.7.0_45]
at com.mchange.v2.ser.SerializableUtils.deserializeFromByteArray(SerializableUtils.java:132) ~[mchange-commons-java-0.2.6.3.jar:0.2.6.3]
at com.mchange.v2.ser.SerializableUtils.fromByteArray(SerializableUtils.java:111) ~[mchange-commons-java-0.2.6.3.jar:0.2.6.3]
at com.mchange.v2.naming.JavaBeanObjectFactory.createPropertyMap(JavaBeanObjectFactory.java:98) ~[mchange-commons-java-0.2.6.3.jar:0.2.6.3]
at com.mchange.v2.naming.JavaBeanObjectFactory.getObjectInstance(JavaBeanObjectFactory.java:59) ~[mchange-commons-java-0.2.6.3.jar:0.2.6.3]
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321) ~[na:1.7.0_45]
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:476) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.jndi.local.localContextRoot.lookup(localContextRoot.java:518) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.jndi.local.localContextRoot.lookup(localContextRoot.java:533) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at javax.naming.InitialContext.lookup(InitialContext.java:411) [na:1.7.0_45]
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:468) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:536) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:536) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:536) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:551) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at org.eclipse.jetty.jndi.java.javaRootURLContext.lookup(javaRootURLContext.java:117) [jetty-jndi-9.1.0.v20131115.jar:9.1.0.v20131115]
at javax.naming.InitialContext.lookup(InitialContext.java:411) [na:1.7.0_45]
at com.example.spring.config.MainConfig.dataSource(MainConfig.java:65) [classes/:na]
at com.example.spring.config.MainConfig$$EnhancerByCGLIB$$8673699d.CGLIB$dataSource$0(<generated>) [cglib-nodep-2.2.2.jar:na]
at com.example.spring.config.MainConfig$$EnhancerByCGLIB$$8673699d$$FastClassByCGLIB$$554d588d.invoke(<generated>) [cglib-nodep-2.2.2.jar:na]
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) [cglib-nodep-2.2.2.jar:na]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:280) [spring-context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at com.example.spring.config.MainConfig$$EnhancerByCGLIB$$8673699d.dataSource(<generated>) [cglib-nodep-2.2.2.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at .............(shortened for brevity)
17:08:33.908 [main] ERROR c.example.spring.config.MainConfig - Couldn't either create InitialContext or couldn't lookup jdbc/myds
javax.naming.NamingException: com.mchange.v2.c3p0.WrapperConnectionPoolDataSource; local class incompatible: stream classdesc serialVersionUID = -7086951306718003710, local class serialVersionUID = 7806429541739165290
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:485)
at org.eclipse.jetty.jndi.local.localContextRoot.lookup(localContextRoot.java:518)
at org.eclipse.jetty.jndi.local.localContextRoot.lookup(localContextRoot.java:533)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:468)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:536)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:536)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:536)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:551)
at org.eclipse.jetty.jndi.java.javaRootURLContext.lookup(javaRootURLContext.java:117)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at com.example.spring.config.MainConfig.dataSource(MainConfig.java:65)
at com.example.spring.config.MainConfig$$EnhancerByCGLIB$$8673699d.CGLIB$dataSource$0(<generated>)
at com.example.spring.config.MainConfig$$EnhancerByCGLIB$$8673699d$$FastClassByCGLIB$$554d588d.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:280)
at com.example.spring.config.MainConfig$$EnhancerByCGLIB$$8673699d.dataSource(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at .............(shortened for brevity)
Can anyone see any misconfiguration on my side?
#Joakim's suggestion helped me locate the problem's source and find a solution. The problem's source didn't have anything to do with Jetty 9.1, instead it stemmed from a Maven dependency library having a transitive dependency on an older C3P0 version 0.9.1.1:
My web application uses the Quartz scheduler, so my application's pom.xml included
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.0</version>
</dependency>
org.quartz-scheduler:quartz:2.2.0 has a dependency on c3p0:c3p0:0.9.1.1.
That old version of C3P0 got into conflict with the newer com.mchange:c3p0:0.9.5-pre6 that I have in my Jetty server instance's lib/etc/ directory.
The solution to my problem is to explicitly exclude Quartz' dependency on that old C3P0 artifact:
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.0</version>
<exclusions>
<exclusion>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
</exclusion>
</exclusions>
</dependency>
At least for my specific Quartz usage, Quartz still works well.