OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to resolve 'No such file or directory' error for startup.sh in Azure App Service deployment?

  • Thread starter Thread starter Lokmane ZEREG
  • Start date Start date
L

Lokmane ZEREG

Guest

Issue:​


I am trying to deploy my Flask/ FastAPI application that uses WebSockets to Azure App Service. The application runs fine locally, but when deploying to Azure, it fails to start with the error: chmod: cannot access '/home/site/wwwroot/startup.sh': No such file or directory.

Project Structure:​


My project repository on GitHub is structured as follows:

Code:
/my-app
├── .github
│   └── workflows
│       └── azure.yml 
├── app.py  
├── requirements.txt
├── folder
├── folder
├── haarcascadeclassifier
└── startup.sh

startup.sh​


Code:
apt-get update
apt-get install -y libgl1-mesa-glx libglib2.0-0

gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 app:app

Azure Configuration: App Service on Linux Python 3.10

Startup Command:​


chmod +x /home/site/wwwroot/startup.sh && /home/site/wwwroot/startup.sh

Logs:​


From the Azure activity log:

Code:
2024-06-26T16:25:28.3624037Z Site's appCommandLine: 'chmod +x /home/site/wwwroot/startup.sh && /home/site/wwwroot/startup.sh'
...
2024-06-26T16:25:29.2838467Z chmod: cannot access '/home/site/wwwroot/startup.sh': No such file or directory
2024-06-26T16:25:29.182.052Z ERROR - Container videoemotion_0_e6593d58 for site videoemotion has exited, failing site start
2024-06-26T16:25:29.064Z ERROR - Container videoemotion_0_e6593d58 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.

What I've Tried:​


Verified that startup.sh is in the root directory of the GitHub repository. Ensured the script is committed and pushed to the repository. Checked the Azure Deployment Center and Log Stream for any additional errors.

Questions:​


Why is the startup.sh script not being found during deployment? How can I ensure the script is correctly recognized and executed by Azure App Service?

Any help or insights would be greatly appreciated!
<h1>Issue:</h1>
<p>I am trying to deploy my Flask/ FastAPI application that uses WebSockets to Azure App Service. The application runs fine locally, but when deploying to Azure, it fails to start with the error: chmod: cannot access '/home/site/wwwroot/startup.sh': No such file or directory.</p>
<h1>Project Structure:</h1>
<p>My project repository on GitHub is structured as follows:</p>
<pre><code>/my-app
├── .github
│ └── workflows
│ └── azure.yml
├── app.py
├── requirements.txt
├── folder
├── folder
├── haarcascadeclassifier
└── startup.sh
</code></pre>
<h1>startup.sh</h1>
<pre><code>apt-get update
apt-get install -y libgl1-mesa-glx libglib2.0-0

gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 app:app

</code></pre>
<p>Azure Configuration:
App Service on Linux
Python 3.10</p>
<h1>Startup Command:</h1>
<p><code>chmod +x /home/site/wwwroot/startup.sh && /home/site/wwwroot/startup.sh </code></p>
<h1>Logs:</h1>
<p>From the Azure activity log:</p>
<pre><code>2024-06-26T16:25:28.3624037Z Site's appCommandLine: 'chmod +x /home/site/wwwroot/startup.sh && /home/site/wwwroot/startup.sh'
...
2024-06-26T16:25:29.2838467Z chmod: cannot access '/home/site/wwwroot/startup.sh': No such file or directory
2024-06-26T16:25:29.182.052Z ERROR - Container videoemotion_0_e6593d58 for site videoemotion has exited, failing site start
2024-06-26T16:25:29.064Z ERROR - Container videoemotion_0_e6593d58 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
</code></pre>
<h1>What I've Tried:</h1>
<p>Verified that startup.sh is in the root directory of the GitHub repository.
Ensured the script is committed and pushed to the repository.
Checked the Azure Deployment Center and Log Stream for any additional errors.</p>
<h1>Questions:</h1>
<p>Why is the startup.sh script not being found during deployment?
How can I ensure the script is correctly recognized and executed by Azure App Service?</p>
<p><em><strong>Any help or insights would be greatly appreciated!</strong></em></p>
Continue reading...
 

Latest posts

D
Replies
0
Views
1
Dhanushka Amarakoon
D
S
Replies
0
Views
1
Shikhar Ambashta
S
Top