Error: Docker build failed

Deployment id:- 4fd045c7-ba05-4851-96e6-458e0541bb2b Trying to deploy a flask app and iam facing this issue while deploying.
No description
74 Replies
Percy
Percy4mo ago
Project ID: 4fd045c7-ba05-4851-96e6-458e0541bb2b
Razerエース
Razerエース4mo ago
@Brody here is the build logs
Brody
Brody4mo ago
please remove all pip based commands that you have set yourself
Razerエース
Razerエース4mo ago
k @Brody getting error no start command found Error: No start command could be found
Brody
Brody4mo ago
put your start command back please
Brody
Brody4mo ago
please remove all pip based commands that you have set yourself
Razerエース
Razerエース4mo ago
latest error logs after adding the build command @Brody @Brody removed all except the build command
Brody
Brody4mo ago
no need for the pings, we are the only two here
Razerエース
Razerエース4mo ago
here is my custom build command pip install gunicorn && pip install -r requirements.txt && python -m pip install pywin32 && gunicorn templates.app:app
Brody
Brody4mo ago
please remove all pip based commands that you have set yourself
Razerエース
Razerエース4mo ago
ok, what should i set for the build command
Brody
Brody4mo ago
why do you think you need a build command?
Razerエース
Razerエース4mo ago
otherwise iam getting module error build command not found if not specified first time deploying so i don't have much knowledge
Brody
Brody4mo ago
you are getting errors regardless, please remove all pip based commands that you have set yourself
Razerエース
Razerエース4mo ago
No description
Brody
Brody4mo ago
you need a start command
Razerエース
Razerエース4mo ago
what should i specify, iam unaware as iam new to it please help me out
Brody
Brody4mo ago
as mentioned before, no pip based commands please, that would leave you with gunicorn templates.app:app
Razerエース
Razerエース4mo ago
k brody its in process
Brody
Brody4mo ago
okay good, next step add this nixpacks.toml file to your project
[phases.setup]
aptPkgs = ['...', 'python3-dev', 'default-libmysqlclient-dev', 'build-essential', 'pkg-config']
[phases.setup]
aptPkgs = ['...', 'python3-dev', 'default-libmysqlclient-dev', 'build-essential', 'pkg-config']
Razerエース
Razerエース4mo ago
k
Razerエース
Razerエース4mo ago
after adding the .toml file
Brody
Brody4mo ago
these logs dont indicate that you added the nixpacks.toml file please show me how/where you added the file
Razerエース
Razerエース4mo ago
No description
Brody
Brody4mo ago
is that the correct repo
Razerエース
Razerエース4mo ago
Yes brody
Brody
Brody4mo ago
did you push to the correct branch
Razerエース
Razerエース4mo ago
yes brody do you want the repo info ?
Brody
Brody4mo ago
yes
Razerエース
Razerエース4mo ago
GitHub
GitHub - chiragpattanaik/flask-api-test
Contribute to chiragpattanaik/flask-api-test development by creating an account on GitHub.
Razerエース
Razerエース4mo ago
Brody is there any issue with repo or the file ?
Brody
Brody4mo ago
im checking
Razerエース
Razerエース4mo ago
k
Brody
Brody4mo ago
what do you have the root directory set to in the service settings?
Razerエース
Razerエース4mo ago
service settings of the railway?
Brody
Brody4mo ago
yes
Razerエース
Razerエース4mo ago
its not set to anything
Brody
Brody4mo ago
what does the providers section say?
Razerエース
Razerエース4mo ago
python
Razerエース
Razerエース4mo ago
No description
Brody
Brody4mo ago
show me the source settings?
Razerエース
Razerエース4mo ago
No description
Brody
Brody4mo ago
delete the service and deploy it again
Razerエース
Razerエース4mo ago
k failed again
Brody
Brody4mo ago
i suggest moving to mysql-connector-python instead
Razerエース
Razerエース4mo ago
u mean the code changes in my repo ? that's what iam using import mysql.connector as connection in my code it mentioned
Razerエース
Razerエース4mo ago
GitHub
flask-api-test/requirements.txt at master · chiragpattanaik/flask-a...
Contribute to chiragpattanaik/flask-api-test development by creating an account on GitHub.
Razerエース
Razerエース4mo ago
line 24 has it
Brody
Brody4mo ago
yes but you are also installing the unneeded packages
Razerエース
Razerエース4mo ago
are u suggesting me to remove that ? because iam bit confuse
Brody
Brody4mo ago
yes of course
Razerエース
Razerエース4mo ago
No description
Razerエース
Razerエース4mo ago
is it deployed now ?
Brody
Brody4mo ago
indeed that's the same screenshot?
Razerエース
Razerエース4mo ago
idk why the ss its coming like this
Brody
Brody4mo ago
what are you trying to show me?
Razerエース
Razerエース4mo ago
[2024-02-24 06:20:54 +0000] [7] [INFO] Starting gunicorn 19.7.1 [2024-02-24 06:20:54 +0000] [7] [INFO] Listening at: http://0.0.0.0:6797 (7) [2024-02-24 06:20:54 +0000] [7] [INFO] Using worker: sync /root/.nix-profile/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used return io.open(fd, *args, **kwargs) [2024-02-24 06:20:54 +0000] [11] [INFO] Booting worker with pid: 11 the deploy logs
Brody
Brody4mo ago
yes that's the same text that's in your screenshot
Razerエース
Razerエース4mo ago
what's my api link then ? how i will find that
Brody
Brody4mo ago
please read that blue banner
Razerエース
Razerエース4mo ago
Brody
Brody4mo ago
please look at the blue banner
Razerエース
Razerエース4mo ago
ok cool got it thanks brody'
Brody
Brody4mo ago
no problem
Razerエース
Razerエース4mo ago
Thanks for all the help and support very much appericiated Brody the api is not working it seems while trying to call via postman its not giving the expected result as it was showing running on my local
Brody
Brody4mo ago
because your code is trying to connect to a database that you have running locally, you need to run a database on railway and have your code connect to that instead
Razerエース
Razerエース4mo ago
oh k thanks once again