How to delete the git repo associated to a project?

As suggested by @mathjazz here I deleted my project to start again from scratch. I went to the admin section and deleted the project.

Now when I try to restart the importation of a new project I get the following error:

2022-02-11T16:39:46.040089+00:00 app[worker.1]: Syncing project fake_locale.
2022-02-11T16:39:46.040117+00:00 app[worker.1]: [2022-02-11 16:39:46,039: INFO/ForkPoolWorker-1] Syncing project fake_locale.
2022-02-11T16:39:46.040154+00:00 app[worker.1]: Pulling source changes for project fake_locale started.
2022-02-11T16:39:46.040173+00:00 app[worker.1]: [2022-02-11 16:39:46,040: INFO/ForkPoolWorker-1] Pulling source changes for project fake_locale started.
2022-02-11T16:39:46.057571+00:00 app[worker.1]: Git: fatal: not a git repository (or any parent up to mount point /)
2022-02-11T16:39:46.057572+00:00 app[worker.1]: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
2022-02-11T16:39:46.057573+00:00 app[worker.1]:
2022-02-11T16:39:46.057644+00:00 app[worker.1]: [2022-02-11 16:39:46,057: INFO/ForkPoolWorker-1] Git: fatal: not a git repository (or any parent up to mount point /)
2022-02-11T16:39:46.057644+00:00 app[worker.1]: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
2022-02-11T16:39:46.057645+00:00 app[worker.1]:
2022-02-11T16:39:46.469885+00:00 app[worker.1]: [2022-02-11 16:39:46,469: ERROR/ForkPoolWorker-1] Task pontoon.sync.tasks.sync_project[8bb23bc9-b053-4c15-a8d4-63c642c91505] raised unexpected: PullFromRepositoryException("fatal: destination path '/app/media/projects/fake_locale/git@github.com:12rambau/fake_locales.git' already exists and is not an empty directory.\n")
2022-02-11T16:39:46.469895+00:00 app[worker.1]: Traceback (most recent call last):
2022-02-11T16:39:46.469902+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/celery/app/trace.py", line 385, in trace_task
2022-02-11T16:39:46.469902+00:00 app[worker.1]: R = retval = fun(*args, **kwargs)
2022-02-11T16:39:46.469902+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/newrelic/hooks/application_celery.py", line 99, in wrapper
2022-02-11T16:39:46.469903+00:00 app[worker.1]: return wrapped(*args, **kwargs)
2022-02-11T16:39:46.469903+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/celery/app/trace.py", line 648, in __protected_call__
2022-02-11T16:39:46.469903+00:00 app[worker.1]: return self.run(*args, **kwargs)
2022-02-11T16:39:46.469904+00:00 app[worker.1]: File "/app/pontoon/sync/core.py", line 68, in wrapped_func
2022-02-11T16:39:46.469904+00:00 app[worker.1]: return func(self, *args, **kwargs)
2022-02-11T16:39:46.469904+00:00 app[worker.1]: File "/app/pontoon/sync/tasks.py", line 98, in sync_project
2022-02-11T16:39:46.469905+00:00 app[worker.1]: source_changes = sync_sources(db_project, now, force, no_pull)
2022-02-11T16:39:46.469905+00:00 app[worker.1]: File "/app/pontoon/sync/tasks.py", line 127, in sync_sources
2022-02-11T16:39:46.469906+00:00 app[worker.1]: has_source_repo_changed = pull_source_repo_changes(db_project)
2022-02-11T16:39:46.469906+00:00 app[worker.1]: File "/app/pontoon/sync/core.py", line 314, in pull_source_repo_changes
2022-02-11T16:39:46.469906+00:00 app[worker.1]: pulled_revisions = source_repo.pull()
2022-02-11T16:39:46.469906+00:00 app[worker.1]: File "/app/pontoon/base/models.py", line 1979, in pull
2022-02-11T16:39:46.469907+00:00 app[worker.1]: update_from_vcs(self.type, self.url, self.checkout_path, self.branch)
2022-02-11T16:39:46.469907+00:00 app[worker.1]: File "/app/pontoon/sync/vcs/repositories.py", line 272, in update_from_vcs
2022-02-11T16:39:46.469907+00:00 app[worker.1]: obj.pull()
2022-02-11T16:39:46.469908+00:00 app[worker.1]: File "/app/pontoon/sync/vcs/repositories.py", line 53, in pull
2022-02-11T16:39:46.469908+00:00 app[worker.1]: raise PullFromRepositoryException(str(error))
2022-02-11T16:39:46.469909+00:00 app[worker.1]: pontoon.sync.vcs.repositories.PullFromRepositoryException: fatal: destination path '/app/media/projects/fake_locale/git@github.com:12rambau/fake_locales.git' already exists and is not an empty directory.

If I understand the log correctly, the git repository is still existing in my pontoon instance (at /app/media/projects/fake_locale/git@github.com:12rambau/fake_locales.git) so I can’t pull it again. Is it a bug or is there an extra manipulation that needs to be done to delete this folder ?

I assume you’re on Heroku, which uses ephemeral storage. That means all the content in the dyno (worker) will be gone after the restart. Dynos restart daily, and you can also force them to restart. I’m unaware of other means of removing specific contents stored on a dyno.

You can also create a project with a different name to avoid the name clash.

thanks I’ll force restart the dynos from my heroku app