Cloning: Failed to download the sources for repository

Hi,

I’m attempting to deploy an app for the first time. It uses poetry for package management, and is hosted on a public GitHub repo. I have my account connected (when deploying, it is able to give me a list of repositories, as well as find the main/master branch).

However, when I deploy it, it fails with:

[13:18:43] πŸš€ Starting up repository: 'cart-constructor', branch: 'main', main module: 'streamlit_app.py'
[13:18:43] πŸ™ Cloning repository...
[13:18:44] πŸ™ Cloning into '/app/cart-constructor'...
[13:18:44] πŸ™ Failed to download the sources for repository: 'cart-constructor', branch: 'main', main module: 'streamlit_app.py'
[13:18:44] πŸ™ Make sure the repository and the branch exist and you have write access to it, and then reboot the app.
[13:20:23] ❗️ Streamlit server consistently failed status checks
[13:20:23] ❗️ Please fix the errors, push an update to the git repo, or reboot the app.

I am completely lost as to why.

I am able to http-clone the repo locally. I have deleted and schedule the deployment of the app multiple times - but without success.

Repo: https://github.com/LinasKo/cart-constructor
App: https://cart-construct.streamlit.app/

Any ideas?

Extra details:

  • Py version: 3.10
  • Main file: streamlit_app.py
  • Main branch: main
  • Added 1 secret

Other tests:

  • Direct GitHub URL to streamlit_app.py - same error.
  • master branch - same error.
  • streamlit run streamlit_app.py runs locally with no issues.

Hm :thinking:

There’s further issues, but you were right!

  1. Moving the config to .streamlit/config.toml got the repo to clone.
  2. Removing poetry.lock got the packages to install
  3. I’ve changed how I’m accessing secrets.

Also, debugging the issue mentioned below, I renamed all references to the project in pyproject.toml to match the folder name of the repo.

Here’s what I get:

[14:48:20] πŸ–₯ Provisioning machine...
[14:48:25] πŸŽ› Preparing system...
[14:48:31] β›“ Spinning up manager process...
[14:48:36] 🎈 Inflating balloons...
[14:48:20] πŸš€ Starting up repository: 'cart-constructor', branch: 'main', main module: 'streamlit_app.py'
[14:48:20] πŸ™ Cloning repository...
[14:48:22] πŸ™ Cloning into '/app/cart-constructor'...
[14:48:22] πŸ™ Cloned repository!
[14:48:22] πŸ™ Pulling code changes from Github...
[14:48:23] πŸ“¦ Processing dependencies...

/app/cart-constructor /app/cart-constructor
Updating dependencies
Resolving dependencies...
Package operations: 115 installs, 0 updates, [2023-07-02 14:48:37.549568] 0 removals
  β€’ Installing exceptiongroup (1.1.1)
  β€’ Installing idna (3.4)
  β€’ Installing six (1.16.0)
  ...
  β€’ Installing tiktoken (0.4.0)
Writing lock file
/app/cart-constructor/cart-constructor does not contain any element
/app/cart-constructor
────────────────────────────────────────────────────────────────────────────────────────
[15:06:10] ❗️ installer returned a non-zero exit code
[15:06:10] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.

By any chance, is there a debug mode to see a more verbose error?

Why is the installer expecting that /app/cart-constructor/cart-constructor exists? I don’t speak poetry, but I suspect there is something wrong in your pyproject.toml.

Alright, solved. It seems that streamlit either doesn’t seem to support poetry yet, or there’s a bug somewhere. I couldn’t even deploy a freshly generated hello-world type project. For anyone else struggling:

  1. poetry export --without-hashes -f requirements.txt -o requirements.txt
  2. Push with requirements.txt included.
  3. Wait a bit, and do the Reboot app action on Streamlit deployment site.

@Goyo, There was one thing incorrect in my poetry file after all, but it ended up being insignificant. I was overzealous in renaming my project, and in fact there’s a line that should read:
packages = [{ include = "cart_constructor" }]
instead of
packages = [{ include = "cart-constructor" }] - it looks for a package with an underscore.

From the looks of the error before, Streamlit it looking for something in /app/<proj-or-repo-name>/<included_package>. In this case, it’s how Streamlit works - not poetry, that causes the issue to appear. Poetry handles dependency management, automatically generates you a virtual environment, but when it comes to running the modules, you can just activate it and do python something.py and that’s it. I’ve never seen it throw any errors past this point, that running python normally wouldn’t.

In terms of the pyproject.toml structure, I tested with the default-generated one in a blank hello-world type project, and I still couldn’t get it to deploy. It would get stuck on β›“ Spinning up manager process.... I tested with and without poetry.lock. That is, until I included requirements.txt and rebooted the deploying app. The pyproject.toml had the same structure as the one in my original question. (only different project / package name & dependencies)

@Franky1, thanks for the help - seeing if removing poetry.lock helps was a good shout - it does prevent the error during dependency installation (though I still couldn’t get the deployment to finish). Although ultimately it wouldn’t be a good solution since poetry.lock is meant to be kept in the repo.

Anyway, thanks everyone for the help - the issue is solved.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.