You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of check_migration/migrate we try and clone the template repository that was used to create a project, and if that repository or reference doesn't exist anymore, we raise an exception.
We should instead return that a template update is not available. And in the case of existing repo but missing reference, still try to allow updates to newer version (like if 2.3.4 tag was originally used but is now deleted, but 2.3.5 exists).
I don't think we need to inform the UI that this is the case, as we should be able to handle everything internally.
Original issue:
This happened because the branch of the template repo from which the project was initialized had been removed. We should handle such cases gracefully.
GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git checkout prep-0.3.1
stderr: 'error: pathspec 'prep-0.3.1' did not match any file(s) known to git'
File "renku/core/metadata/repository.py", line 1397, in _run_git_command
return getattr(repository.git, command)(*args, **kwargs)
File "git/cmd.py", line 638, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "git/cmd.py", line 1183, in _call_process
return self.execute(call, **exec_kwargs)
File "git/cmd.py", line 983, in execute
raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
GitCommandError: Git command failed: Cmd('git') failed due to: exit code(1)
cmdline: git checkout prep-0.3.1
stderr: 'error: pathspec 'prep-0.3.1' did not match any file(s) known to git'
File "renku/core/utils/git.py", line 571, in clone_repository
repository.checkout(checkout_revision)
File "renku/core/metadata/repository.py", line 186, in checkout
self.run_git_command("checkout", reference)
File "renku/core/metadata/repository.py", line 263, in run_git_command
return _run_git_command(self._repository, command, *args, **kwargs)
File "renku/core/metadata/repository.py", line 1405, in _run_git_command
) from e
GitReferenceNotFoundError: Cannot checkout reference 'prep-0.3.1' in repository: https://github.com/swissdatasciencecenter/renku-project-template
File "renku/core/management/template/template.py", line 427, in fetch
repository = clone_repository(url=source, path=path, checkout_revision=reference, install_lfs=False)
File "renku/core/utils/git.py", line 574, in clone_repository
f"Cannot checkout reference '{checkout_revision}' in repository: {url}"
InvalidTemplateError: Cannot clone template repository from https://github.com/swissdatasciencecenter/renku-project-template
(17 additional frame(s) were not displayed)
...
File "renku/core/commands/migrate.py", line 53, in _migrations_check
"template_status": _template_migration_check(client),
File "renku/core/commands/migrate.py", line 87, in _template_migration_check
update_available, update_allowed, current_version, new_version = check_for_template_update(client)
File "renku/core/management/template/usecase.py", line 72, in check_for_template_update
templates_source = fetch_templates_source(source=metadata.source, reference=metadata.reference)
File "renku/core/management/template/template.py", line 84, in fetch_templates_source
else RepositoryTemplates.fetch(source, reference)
File "renku/core/management/template/template.py", line 429, in fetch
raise errors.InvalidTemplateError(f"Cannot clone template repository from {source}") from e
The text was updated successfully, but these errors were encountered:
Panaetius
changed the title
InvalidTemplateError: Cannot clone template repository
change cache.check_migration and cache.migrate to gracefully handle if a template repository doesn't exist anymore
Mar 22, 2022
As part of check_migration/migrate we try and clone the template repository that was used to create a project, and if that repository or reference doesn't exist anymore, we raise an exception.
We should instead return that a template update is not available. And in the case of existing repo but missing reference, still try to allow updates to newer version (like if 2.3.4 tag was originally used but is now deleted, but 2.3.5 exists).
I don't think we need to inform the UI that this is the case, as we should be able to handle everything internally.
Original issue:
This happened because the branch of the template repo from which the project was initialized had been removed. We should handle such cases gracefully.
Sentry Issue: RENKU-PYTHON-4C
The text was updated successfully, but these errors were encountered: