質問編集履歴

5

追記

2022/07/18 08:55

投稿

myao
myao

スコア116

test CHANGED
File without changes
test CHANGED
@@ -144,7 +144,31 @@
144
144
  ERROR: No matching distribution found for python-3.9.13
145
145
  ```
146
146
  とビルドエラーが返された。
147
+
147
- runtime.txt を消去、requirements.txt に Python のバージョンを記載後、デプロイすると、上記と同様のビルドエラーが返されました。
148
+ runtime.txt を消去、requirements.txt に Python のバージョンを記載後、デプロイすると、上記と同様のビルドエラーが返されました。
149
+
150
+ ・runtime.txt はそのままで以下の Pipfile を追加後、デプロイ。本番環境で動作確認すると、No Found になり、アプリケーションログ、git push heroku main の結果も変わらなかった。
151
+ ```ここに言語を入力
152
+ [[source]]
153
+
154
+ url = "https://pypi.python.org/simple"
155
+ verify_ssl = true
156
+ name = "pypi"
157
+
158
+
159
+ [packages]
160
+
161
+
162
+
163
+ [dev-packages]
164
+
165
+
166
+
167
+ [requires]
168
+
169
+ python_version = "3.9.13"
170
+ ```
171
+
148
172
 
149
173
 
150
174
 

4

追記

2022/07/18 08:18

投稿

myao
myao

スコア116

test CHANGED
File without changes
test CHANGED
@@ -136,6 +136,18 @@
136
136
  ---
137
137
  ・アプリを消去し、ビルドパックを heroku/python に設定後、再度アプリケーションを本番環境で動作させてみるが変わらず No Found になり、アプリケーションログ、git push heroku main の結果も変わらなかった。
138
138
 
139
+ ・Pyhon buildpack(https://github.com/heroku/heroku-buildpack-python/blob/61609930c167e04ea4b41027e725ac46f7270e72/bin/detect)
140
+ によると、Python  のプロジェクトかどうかは、requirements.txt、setup.py、Pipfile のどれかがあるかどうかで判定しているらしい。。 (runtime.txt に記載してるが、)
141
+ requirements.txt に Python のバージョンを記載後、デプロイ
142
+ ```ここに言語を入力
143
+ ERROR: Could not find a version that satisfies the requirement python-3.9.13 (from versions: none)
144
+ ERROR: No matching distribution found for python-3.9.13
145
+ ```
146
+ とビルドエラーが返された。
147
+ runtime.txt を消去、requirements.txt に Python のバージョンを記載後、デプロイすると、上記と同様のビルドエラーが返されました。
148
+
149
+
150
+
139
151
 
140
152
  ### 補足情報(FW/ツールのバージョンなど)
141
153
 

3

追記

2022/07/18 07:48

投稿

myao
myao

スコア116

test CHANGED
File without changes
test CHANGED
@@ -129,7 +129,13 @@
129
129
  ! [remote rejected] main -> main (pre-receive hook declined)
130
130
  error: failed to push some refs to 'https://git.heroku.com/app.git'
131
131
  ```
132
- 新しくエラーが見つかった。
132
+ 「ビルドパックと互換性のないアプリ」と新しくエラーが見つかった。
133
+ しかし、heroku/python と正しいビルドパックが設定されている。
134
+
135
+ **追記**
136
+ ---
137
+ ・アプリを消去し、ビルドパックを heroku/python に設定後、再度アプリケーションを本番環境で動作させてみるが変わらず No Found になり、アプリケーションログ、git push heroku main の結果も変わらなかった。
138
+
133
139
 
134
140
  ### 補足情報(FW/ツールのバージョンなど)
135
141
 

2

誤字

2022/07/18 07:16

投稿

myao
myao

スコア116

test CHANGED
File without changes
test CHANGED
@@ -74,7 +74,7 @@
74
74
 
75
75
  **試したこと**
76
76
  ---
77
- Heroku stackを20から22にバックアップしてみるため、アプリケーションをPython 3.9.13 で再作成。
77
+ Heroku stackを20から22にアップグレードしてみるため、アプリケーションをPython 3.9.13 で再作成。
78
78
  その後、Heroku-22 stackに本番環境を指定した。本番環境でアプリケーションで動作させると、変わらず Not Found なった。
79
79
  ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-07-17/b371ec92-faf1-49d6-a4f9-adfff6246d03.png)
80
80
 

1

追記

2022/07/17 16:50

投稿

myao
myao

スコア116

test CHANGED
File without changes
test CHANGED
@@ -13,29 +13,6 @@
13
13
  ### 発生している問題・エラーメッセージ
14
14
  **アプリケーションログ**
15
15
  ```
16
- 2022-07-17T11:40:50.429324+00:00 heroku[web.1]:
17
- Process exited with status 0
18
-
19
- 2022-07-17T11:40:53.030933+00:00 heroku[web.1]:
20
- Starting process with command `gunicorn mysite.wsgi --log-file -`
21
-
22
- 2022-07-17T11:40:54.165770+00:00 app[web.1]:
23
- [2022-07-17 11:40:54 +0000] [4] [INFO] Starting gunicorn 20.1.0
24
-
25
- 2022-07-17T11:40:54.166194+00:00 app[web.1]:
26
- [2022-07-17 11:40:54 +0000] [4] [INFO] Listening at: http://0.0.0.0:38305 (4)
27
-
28
- 2022-07-17T11:40:54.166235+00:00 app[web.1]:
29
- [2022-07-17 11:40:54 +0000] [4] [INFO] Using worker: sync
30
-
31
- 2022-07-17T11:40:54.169029+00:00 app[web.1]:
32
- [2022-07-17 11:40:54 +0000] [10] [INFO] Booting worker with pid: 10
33
-
34
- 2022-07-17T11:40:54.233185+00:00 app[web.1]:
35
- [2022-07-17 11:40:54 +0000] [11] [INFO] Booting worker with pid: 11
36
-
37
- 2022-07-17T11:40:54.692776+00:00 heroku[web.1]: State changed from starting to up
38
-
39
16
  2022-07-17T11:40:57.931586+00:00 heroku[router]:
40
17
  at=info method=GET path="/" host=app.herokuapp.com
41
18
  request_id=b14646e6-e807-4ddc-a59c-835c15014d05 fwd="126.251.50.72" dyno=web.1
@@ -49,7 +26,6 @@
49
26
 
50
27
 
51
28
  **git push heroku main の結果**
52
- ---
53
29
  ```ここに言語名を入力
54
30
  Enumerating objects: 15, done.
55
31
  Counting objects: 100% (15/15), done.
@@ -96,16 +72,74 @@
96
72
  3c5974a..8406b1e main -> main
97
73
  ```
98
74
 
75
+ **試したこと**
76
+ ---
77
+ Heroku stackを20から22にバックアップしてみるため、アプリケーションをPython 3.9.13 で再作成。
78
+ その後、Heroku-22 stackに本番環境を指定した。本番環境でアプリケーションで動作させると、変わらず Not Found なった。
79
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-07-17/b371ec92-faf1-49d6-a4f9-adfff6246d03.png)
80
+
81
+ **アプリケーションログ**
82
+ ```ここに言語を入力
83
+ 2022-07-17T16:45:26.563028+00:00 heroku[router]:
84
+ at=info method=GET path="/" host=ma-qwuchan.herokuapp.com
85
+ request_id=c11ba0be-1ab3-4f9a-abaa-b2fb8dbb51cd fwd="126.251.50.72" dyno=web.1
86
+ connect=0ms service=11ms status=404 bytes=452 protocol=https
87
+
88
+ 2022-07-17T16:45:26.562847+00:00 app[web.1]:
89
+ 10.1.3.249 - - [18/Jul/2022:01:45:26 +0900] "GET / HTTP/1.1" 404 179 "https://dashboard.heroku.com/"
90
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
91
+ Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.62"
92
+ ```
93
+
94
+ **git push heroku main の結果**
95
+ ```ここに言語を入力
96
+ Enumerating objects: 112, done.
97
+ Counting objects: 100% (112/112), done.
98
+ Delta compression using up to 4 threads
99
+ Compressing objects: 100% (99/99), done.
100
+ Writing objects: 100% (112/112), 33.25 KiB | 1.96 MiB/s, done.
101
+ Total 112 (delta 36), reused 0 (delta 0), pack-reused 0
102
+ remote: Compressing source files... done.
103
+ remote: Building source:
104
+ remote:
105
+ remote: -----> Building on the Heroku-22 stack
106
+ remote: -----> Using buildpack: heroku/python
107
+ remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
108
+ remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
109
+ remote:
110
+ remote: ! Push failed
111
+ remote: !
112
+ remote: ! ## Warning - The same version of this code has already been built: 30dbe438944d1004c01d5396fe49b6e01507e0bb
113
+ remote: !
114
+ remote: ! We have detected that you have triggered a build from source code with version 30dbe438944d1004c01d5396fe49b6e01507e0bb
115
+ remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
116
+ remote: !
117
+ remote: ! If you are developing on a branch and deploying via git you must run:
118
+ remote: !
119
+ remote: ! git push heroku <branchname>:main
120
+ remote: !
121
+ remote: ! This article goes into details on the behavior:
122
+ remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
123
+ remote:
124
+ remote: Verifying deploy...
125
+ remote:
126
+ remote: ! Push rejected to app.
127
+ remote:
128
+ To https://git.heroku.com/app.git
129
+ ! [remote rejected] main -> main (pre-receive hook declined)
130
+ error: failed to push some refs to 'https://git.heroku.com/app.git'
131
+ ```
132
+ 新しくエラーが見つかった。
99
133
 
100
134
  ### 補足情報(FW/ツールのバージョンなど)
101
135
 
102
136
  【ローカル】
103
- Python3.8.13
137
+ Python3.8.1 3⇒ Python 3.9.13
104
138
  Heroku7.60.2
105
139
  Windows home10
106
140
  Git 2.36.1.
107
141
  Sqlite3 3.36.0
108
142
 
109
143
  【本番環境】
110
-  Heroku
144
+  Heroku-20 stack ⇒ Heroku-22 stack
111
145