plone / cookieplone

Create Plone projects, addons, documentation with ease!
MIT License
4 stars 1 forks source link

cookieplone startup hangs with no output/template selection: git clone of cookieplone-templates fails but with different error output #33

Open fredvd opened 1 month ago

fredvd commented 1 month ago

My cookieplone refused to start up this morning. You should see a welcome screen with the template selection. I noticed https-remote-get in the terminal title, so I checked what was checked out, https://github.com/plone/cookieplone-templates.git .

Testing the git clone of that repo in another terminal and directory worked find.

After 1-2 minutes cookieplone aborted with a traceback:

│ │ capture_output = False                                                                       │ │
│ │          check = True                                                                        │ │
│ │          input = None                                                                        │ │
│ │         kwargs = {                                                                           │ │
│ │                  │   'stdout': -1,                                                           │ │
│ │                  │   'cwd': PosixPath('/Users/fred/.cookiecutters'),                         │ │
│ │                  │   'stderr': -2                                                            │ │
│ │                  }                                                                           │ │
│ │      popenargs = (['git', 'clone', 'https://github.com/plone/cookieplone-templates.git'],)   │ │
│ │        process = <Popen: returncode: 128 args: ['git', 'clone',                              │ │
│ │                  'https://github.com/plone/coo...>                                           │ │
│ │        retcode = 128                                                                         │ │
│ │         stderr = None                                                                        │ │
│ │         stdout = b"Cloning into 'cookieplone-templates'...\nfatal: unable to access          │ │
│ │                  'https://github."+123                                                       │ │
│ │        timeout = None

Debugging this somewhat further I found out that an directory had been created at ~/.cookiecutters/cookieplone-templates/ . When I removed this directory, cookieplone was able to clone the repo and start up properly with a list of available templates.

What I cannot pinpoint is that the error message in the traceback mentions it cannot access github, pointing to network issues. But the real problem is a halfway finished git clone that leaves a checkout in an inconsistent state. In that case, when I try to reproduce this, I see another error:

git clone https://github.com/plone/cookieplone-templates.git fatal: destination path 'cookieplone-templates' already exists and is not an empty directory.

I'm not sure what to make of this, I just found out there are issues with my internet connection reported by the provider this morning. But an incomplete git clone of the cookiecutter-templates seem to generate an edge case where cookieplone gets stuck and the traceback reported by git back to cookieplone's CallProcess is not necessarily correct.

Also in hindsight I forgot to closer check the ~/.cookiecutters/cookieplone-templates/ . with an empty directory git clone just works. With a fully cloned directory you see the "fatal: destination path" error. But my halfway cloned copy triggered a network traceback? :-O

davisagli commented 1 month ago

I suspect this is something that needs to be fixed in cookiecutter rather than cookieplone.