Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README generation error occurred: Failed to clone repository: Unexpected error while cloning repository https://github.com/gtkacz/... #116

Open
gtkacz opened this issue Sep 13, 2024 · 3 comments

Comments

@gtkacz
Copy link

gtkacz commented Sep 13, 2024

Can't use the tool on any of my repositories because I keep getting README generation error occurred: Failed to clone repository: Unexpected error while cloning repository https://github.com/gtkacz/.... More details below:

  • Python version: 3.11.6
  • readmeai version: 0.5.87
  • OS: Windows Pro 10.0.19045 Build 19045

Full stack trace:

D:\>readmeai --repository https://github.com/gtkacz/undergrad_thesis --api gemini --model gemini-1.5-pro
► INFO | 2024-09-13 16:17:43 | readmeai.core.utils | GEMINI settings FOUND in environment!
► INFO | 2024-09-13 16:17:43 | readmeai.config.settings | Config loaded: settings/C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\config\settings\commands.toml
► INFO | 2024-09-13 16:17:43 | readmeai.config.settings | Config loaded: settings/C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\config\settings\ignore_list.toml
► INFO | 2024-09-13 16:17:43 | readmeai.config.settings | Config loaded: settings/C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\config\settings\languages.toml
► INFO | 2024-09-13 16:17:43 | readmeai.config.settings | Config loaded: settings/C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\config\settings\markdown.toml
► INFO | 2024-09-13 16:17:43 | readmeai.config.settings | Config loaded: settings/C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\config\settings\parsers.toml
► INFO | 2024-09-13 16:17:43 | readmeai.config.settings | Config loaded: settings/C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\config\settings\prompts.toml
► INFO | 2024-09-13 16:17:43 | readmeai.__main__ | Repository settings updated: repository='https://github.com/gtkacz/undergrad_thesis' git_url=None full_name='gtkacz/undergrad_thesis' host_domain='github.com' host='github' name='undergrad_thesis'
► INFO | 2024-09-13 16:17:43 | readmeai.__main__ | LLM API settings updated: api='GEMINI' base_url='https://api.openai.com/v1/chat/completions' context_window=3999 encoder='cl100k_base' host_name=Url('https://api.openai.com/') localhost=Url('http://localhost:11434/') model='gemini-1.5-pro' path='v1/chat/completions' temperature=0.9 tokens=699 top_p=0.9
ⓧ ERROR | 2024-09-13 16:17:44 | readmeai.vcs.ingestor | Unexpected error while cloning repository https://github.com/gtkacz/undergrad_thesis: [WinError 5] Access is denied: 'C:\\Users\\Gabriel\\AppData\\Local\\Temp\\tmprom5eoi6\\.git\\objects\\pack\\pack-4ecd906823798eb227471528cf9d22a649d94a2a.idx'
ⓧ ERROR | 2024-09-13 16:17:44 | readmeai.__main__ | Error in README generation process: Failed to clone repository: Unexpected error while cloning repository https://github.com/gtkacz/undergrad_thesis
Traceback (most recent call last):
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\vcs\ingestor.py", line 89, in retrieve_repository
    await remove_hidden_contents(temp_dir_path)
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\vcs\ingestor.py", line 68, in remove_hidden_contents
    shutil.rmtree(item)
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\shutil.py", line 759, in rmtree
    return _rmtree_unsafe(path, onerror)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\shutil.py", line 617, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\shutil.py", line 617, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\shutil.py", line 622, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\shutil.py", line 620, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\Gabriel\\AppData\\Local\\Temp\\tmprom5eoi6\\.git\\objects\\pack\\pack-4ecd906823798eb227471528cf9d22a649d94a2a.idx'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\__main__.py", line 36, in error_handler
    yield
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\__main__.py", line 97, in readme_agent
    asyncio.run(readme_generator(conf, output))
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\__main__.py", line 105, in readme_generator
    await retrieve_repository(conf.config.git.repository, tmp_dir)
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\vcs\ingestor.py", line 107, in retrieve_repository
    raise GitCloneError(
readmeai.vcs.errors.GitCloneError: Failed to clone repository: Unexpected error while cloning repository https://github.com/gtkacz/undergrad_thesis

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Scripts\readmeai.exe\__main__.py", line 7, in <module>
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\cli\main.py", line 49, in main
    readme_agent(
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\__main__.py", line 64, in readme_agent
    with error_handler():
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\Gabriel\.pyenv\pyenv-win\versions\3.11.6\Lib\site-packages\readmeai\__main__.py", line 39, in error_handler
    raise ReadmeGeneratorError(exc, traceback.format_exc()) from exc
readmeai._exceptions.ReadmeGeneratorError: README generation error occurred: Failed to clone repository: Unexpected error while cloning repository https://github.com/gtkacz/undergrad_thesis
@JuanMolina2001
Copy link

JuanMolina2001 commented Oct 8, 2024

that's because of windows permissions issues, clone the repository and use the local path
readmeai --repository C:\path\to\repository --api gemini --model gemini-1.5-pro
a little late :p

@gtkacz
Copy link
Author

gtkacz commented Oct 8, 2024

@JuanMolina2001 thanks for the answer! I was running the cmd in admin mode, does that still create this problem?

@themodmin
Copy link

same problem for me and when i tried using local clone i get : Invalid Git repository URL or path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants