Heroku 배포 오류 H10 (앱 충돌)
로컬 컴퓨터에서 RoR 앱을 사용하고 있지만 heroku로 보낼 때 충돌이 발생합니다. 오류 로그에 오류 H10이 표시되고 다음과 같이 표시됩니다.
2012-11-21T15:26:47+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.4.2/lib/new_relic/control/instance_methods.rb:95:in `start_agent'
2012-11-21T15:26:48+00:00 heroku[web.1]: State changed from starting to crashed
2012-11-21T15:26:48+00:00 heroku[web.1]: Process exited with status 1
2012-11-21T15:26:59+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
2012-11-21T15:27:00+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
2012-11-21T15:30:08+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
2012-11-21T15:30:08+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
2012-11-21T15:30:59+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
2012-11-21T15:31:19+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
2012-11-21T15:31:19+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
2012-11-21T15:32:08+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
2012-11-21T15:32:08+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
편집하다:
2012-11-22T10:00:58+00:00 app[web.1]:
2012-11-22T10:00:59+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=xxx.herokuapp.com fwd= dyno=web.1 queue=0 wait=0ms connect=1ms service=26ms status=200 bytes=0
누구든지 전에 이것을 가지고 있었고, 문제를 일으키는 원인을 알고 있습니까? 해결책을 찾을 수 없습니다.
감사.
위의 동일한 오류가 발생하여 앱이 heroku에서 충돌하고 (dev에서 잘 실행 중) heroku의 오류 로그에 단서가 표시되지 않았습니다. 이 페이지에서 다른 답변을 읽고 "앱 재 구축"을 본 후 땀을 흘 렸습니다. 어쩌면 헤 로쿠 콘솔에 들어가서 둘러 볼 수있을 것 같아요. 나는 콘솔조차도 추락했지만 이번에는 그 이유를 말해주었습니다. 문제 해결 세션 시간 전에 삭제하는 것을 잊어 버린 일부 모호한 변수였습니다. 나는 당신이 같은 문제에 부딪 칠 것이라고 말하지는 않지만 콘솔을 살펴 보았을 때 더 많은 정보를 찾았습니다. 도움이 되었기를 바랍니다.
$ heroku run rails console
나는 같은 문제를 겪고 있었다. 통나무도 나에게 단서를주지 못했습니다. 그래서 나는 스케일을 줄이고 스케일을 다시 올렸다. 이것은 나를 위해 문제를 해결했습니다.
heroku ps:scale web=0
몇 초 기다렸다 ...
heroku ps:scale web=1
$heroku run rails console
Heroku 로그의 'app crashed'오류보다 훨씬 자세한 오류가 터미널에 표시되므로 가장 좋은 옵션입니다.
$ heroku restart
내 dyno를 다시 실행하는 데 도움이되었습니다. 나는 Heroku를 처음 사용하지만 지금은 기쁘다.
잘못된 포트에서 듣고있을 때 이런 일이 일어났습니다
listen ()을 "process.env.PORT"로 변경했습니다.
http.listen((process.env.PORT || 5000), function(){
console.log('listening on *:5000');
});
대신에
http.listen(5000, function(){
console.log('listening on *:5000');
});
오늘 저녁에도 같은 문제가있었습니다. 매우 유용한 오류는 아니므로 콘솔에서 실행을 시도했습니다.
heroku run rails c
실패했고 훨씬 더 유용한 오류가 발생했습니다. 프로덕션에서 메소드 호출을 삭제하지 않았습니다. 일단 수정하면 앱이 정상적으로 작동했습니다.
Git으로 푸시 하여이 문제를 해결했습니다.
git add .
git commit -am "some text"
git push
그런 다음 Heroku로 푸시하십시오.
git push heroku
그런 다음 Heroku에서 db : migrate를 레이크하십시오.
heroku run rake db:migrate
.gitignore 파일-> heroku을 손상시키는 파일을 포함시키지 못했습니다. #도
작동하는 .gitignore 파일은 다음과 같습니다.
/.bundle
/vendor/bundle/
/vendor/ruby/
db/*.sqlite3
/db/*.sqlite3-journal
/log/*
/tmp/*
**.war
*.rbc
*.sassc
.redcar/
.sass-cache
/config/config.yml
/config/database.yml
/coverage.data
/coverage/
/db/*.javadb/
/db/*.sqlite3
/doc/api/
/doc/app/
/doc/features.html
/doc/specs.html
/public/cache
/public/stylesheets/compiled
/public/system/*
/spec/tmp/*
/cache
/capybara*
/capybara-*.html
/gems
/specifications
rerun.txt
pickle-email-*.html
.zeus.sock
**.orig
.DS_Store
/nbproject/
.idea
/*.tmproj
**.swp
.env
.powenv
To create a .gitignore file, in terminal navigate to your apps directory and use the following command
touch .gitignore
Then you can open it up in a your text editor and put the above code into it.
In my case i was using ENV variables in my app, but it was not set in heroku config.
heroku console gave proper error:
heroku console
`validate_options': Missing required arguments: aws_access_key_id, aws_secret_access_key (ArgumentError)
Then set the ENV config
heroku config:set AWS_ACCESS_KEY_ID='key'
Restart the Heroku
heroku restart
it works!!
I was getting this same H10 app crashed error in Heroku. I clicked 'restart all dynos' in the heroku interface, and problem solved.
I had H10
with Heroku and Node due to wrong name of the main code file. Edit package.json
:
{
...
"main": "correct_file_name.js",
...
"scripts": {
"start": "node correct_file_name.js"
}
}
Or rename the file.
See if you get
bash: bin/rails: No such file or directory
in logs while running (heroku logs -t) command if yes then please Run
bundle exec rake rails:update
Don't overwrite your files, in the end this command will create
create bin
create bin/bundle
create bin/rails
create bin/rake
push these files to heroku and you are done.
The root of the problem I was facing was due to not having a database. To resolve the problem I first exported my local database:
$ heroku addons:add heroku-postgresql:dev
$ heroku addons:add pgbackups
$ PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump
Then imported it into Heroku:
$ heroku pgbackups:restore DATABASE 'http://site.tld/mydb.dump'
The variables to replace in these examples are: mypassword
, myuser
, mydb
& http://site.tld/mydb.dump
. Note that I had to upload the dump to a temporary server.
Resolving all my problems I wrote up a quick guide on how to deploy Enki to Heroku, which can be found here.
I got the same above error as "app crashed" and the heroku app logs is not showing much info related to the error msg reasons. Then I restarted the dynos in heroku and then it showed the error saying additional curly brace in one of the index.js files in my setup. The issue got fixed once it is removed and redeployed the app on heroku.
Hope this will be helpful to someone facing the same issue.
After going through the entire list of answers I stumbled upon this website: https://status.heroku.com/ which details the current status/incidents with Heroku. Its always safe to check out for incidents before banging your head against the wall. For me, it was the attached incident report published on the above mentioned link that was causing the error.
I had the same problem, I did the following
heroku run rails c
It identified a syntax error and missing comma within a controller permitted params. As mentioned above the Heroku logs did not provide sufficient information to problem solve the problem.
I have not seen the application crashed message on Heroku previously.
I encountered the same problem today. I did heroku run rake db:migrate
though I migrated the model before, and the app doesn't crash.
Be very cautious of copy and pasting code. Sometimes when you add a block into a file, it is formatted incorrectly and will yield an error.
I've had this problem before and got this error: unexpected tIDENTIFIER, expecting keyword_end
Had same problem. for me it was error in before_action filters(because empty DB) Check your before_action filters, maybe they throw unhendled exeptions.
I had this problem when trying to run Rails in a subdirectory, and not in /
. For example, I had Angular/Node/Gulp app running in /client
and a Rails app running in /server
, but both of them were in the same git repo, so I could track changes across the front end and back end. I got this error when trying to deploy them to Heroku. For anyone else having this issue, here is a custom buildpack that will allow running Rails in a subdirectory.
https://github.com/aarongray/heroku-buildpack-ruby
I had the same issue (same error on heroku, working on local machine) and I tried all the solutions listed here including heroku run rails console
which ran without error messages. I tried heroku run rake db:migrate
and heroku run rake db:migrate:reset
a few times. None of this solved the problem. On going through some files that are used in production but not in dev environment, I found some whitespace in the puma.rb file to be the culprit. Hope this helps someone who has the same issue. Changing this made it work
ActiveRecord::Base.establish_connection
End
to
ActiveRecord::Base.establish_connection
end
I ran into the same issue while deploying to Heroku (app crash). Logs did not indicate what the problem could be. Heroku console displayed syntax error in the code of an extra bracket. Surprisingly, I did not have an issue on local rails while running the app and hence missed it. After correction and git push to Heroku, the app started working on Heroku!
I updated my settings from app.set('ip_address', process.env.IP || '127.0.0.1');
to
app.set('ip_address', process.env.IP || '0.0.0.0');
which i changed for Openshift hosting
In my case the Procfile
I used was breaking everything. Heroku looks for Procfile
and applies its settings when launching the app - clearly the dev settings I used didn't make any sense for the prod server. I had to rename it to Procfile.dev
and everything started working normally.
I had the same issue when I started using Puma in heroku as per their guide page, this issue was solved when I commented the port line shown below
# port ENV['PORT'] || 3000
So, disabling the above line in the puma.rb in the config directory solved the issue
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
# port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'production'
on_worker_boot do
# Worker specific setup for Rails 4.1+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
ActiveRecord::Base.establish_connection
end
If you're using Node, you can try running the serve command directly in the console. In my case I'm running an angular application, so I tried with:
heroku run npm start
This showed me the exact error during the application startup.
참고URL : https://stackoverflow.com/questions/13496827/heroku-deployment-error-h10-app-crashed
'IT story' 카테고리의 다른 글
Linux cat 명령을 사용하여 텍스트를 파일에 쓸 수 있습니까? (0) | 2020.07.12 |
---|---|
구성 요소 속성이 현재 날짜 시간에 의존하는 경우 Angular2“확인 후 표현식이 변경되었습니다”예외를 관리하는 방법 (0) | 2020.07.12 |
Java 배열에서 모든 숫자의 합계를 어떻게 찾습니까? (0) | 2020.07.12 |
System.out.println ()을 짧게 만드는 방법 (0) | 2020.07.12 |
숫자가 두 값 사이에 있는지 확인하는 방법은 무엇입니까? (0) | 2020.07.12 |