LoginSignup
2
3

エラー内容

エラーコード

C:\Users\myname\GitHub\study_go>heroku restart --app go-api       
Restarting dynos on ⬢ go-api... done

C:\Users\myname\GitHub\study_go>heroku logs --tail
2024-06-10T17:43:11.476157+00:00 app[web.1]: /bin/bash: line 1: ./starter: Permission denied
2024-06-10T17:43:11.523112+00:00 heroku[web.1]: Process exited with status 126   
2024-06-10T17:43:11.546061+00:00 heroku[web.1]: State changed from starting to crashed
2024-06-10T17:43:11.548837+00:00 heroku[web.1]: State changed from crashed to starting
2024-06-10T17:43:12.291243+00:00 heroku[web.1]: Starting process with command `./starter`
2024-06-10T17:43:12.968051+00:00 app[web.1]: /bin/bash: line 1: ./starter: Permission denied
2024-06-10T17:43:13.027358+00:00 heroku[web.1]: Process exited with status 126   
2024-06-10T17:43:13.050687+00:00 heroku[web.1]: State changed from starting to crashed
2024-06-10T17:43:32.000000+00:00 app[api]: Build succeeded
2024-06-10T17:43:48.130101+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=go-api-7c4e0807af28.herokuapp.com request_id=73332a2b-cc71-47e5-afec-74ddc1a4beb1 fwd="121.81.190.72" dyno= connect= service= status=503 bytes= protocol=https
2024-06-10T17:43:49.342060+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=go-api-7c4e0807af28.herokuapp.com request_id=7017cbb0-a00f-46b4-8a3c-05f34538e9e7 fwd="121.81.190.72" dyno= connect= service= status=503 bytes= protocol=https

原因箇所

2024-06-10T17:43:11.476157+00:00 app[web.1]: /bin/bash: line 1: ./starter: Permission denied

どうやらstarterに実行権限が与えられていないらしい.

starterとは?
下記のコマンドで作成した実行可能ファイル

go build -o starter main.go

作成したstarterをWSLで権限を見ても一見問題なさそう?
777な時点でダメか?w

-rwxrwxrwx 1 myname myname 9912472 mayname 11 04:13 starter

デプロイ後のstarterの権限を見てみると
変更されてる??

-rw------- 1 u37039 dyno 14393782 misname 10 19:00 starter

対処法

もともとはProcfileを使用して下記のコマンドで実行していた

web: ./starter

それを
Procfileを書かないようにした.

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3