Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Fails on windows because file names are too long #9

Open
holgerbrandl opened this issue Mar 26, 2019 · 2 comments
Open

Fails on windows because file names are too long #9

holgerbrandl opened this issue Mar 26, 2019 · 2 comments

Comments

@holgerbrandl
Copy link

$ cookiecutter gh:spinscale/cookiecutter-elasticsearch-ingest-processor
Traceback (most recent call last):
  File "C:\Users\brandl\AppData\Local\Continuum\anaconda3\envs\elastic-helpers\Scripts\cookiecutter-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\brandl\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\brandl\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "C:\Users\brandl\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\brandl\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\brandl\AppData\Roaming\Python\Python36\site-packages\cookiecutter\cli.py", line 120, in main
    password=os.environ.get('COOKIECUTTER_REPO_PASSWORD')
  File "C:\Users\brandl\AppData\Roaming\Python\Python36\site-packages\cookiecutter\main.py", line 63, in cookiecutter
    password=password
  File "C:\Users\brandl\AppData\Roaming\Python\Python36\site-packages\cookiecutter\repository.py", line 103, in determine_repo_dir
    no_input=no_input,
  File "C:\Users\brandl\AppData\Roaming\Python\Python36\site-packages\cookiecutter\vcs.py", line 99, in clone
    stderr=subprocess.STDOUT,
  File "C:\Users\brandl\AppData\Local\Continuum\anaconda3\envs\elastic-helpers\lib\subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "C:\Users\brandl\AppData\Local\Continuum\anaconda3\envs\elastic-helpers\lib\subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/spinscale/cookiecutter-elasticsearch-ingest-processor.git']' returned non-zero exit status 128.

So I've tried to check it out manually and it turned out that

$ git clone https://github.com/spinscale/cookiecutter-elasticsearch-ingest-processor.git
Cloning into 'cookiecutter-elasticsearch-ingest-processor'...
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 574 (delta 11), reused 25 (delta 8), pack-reused 546R
Receiving objects: 100% (574/574), 206.09 KiB | 575.00 KiB/s, done.
Resolving deltas: 100% (235/235), done.
error: unable to create file ingest-{{ cookiecutter.processor_type }}/src/main/java/org/elasticsearch/plugin/ingest/{{ cookiecutter.package_dir }}/Ingest{{ cookiecutter.processor_type | title | replace("-", "") }}Plugin.java: Filename too long
error: unable to create file ingest-{{ cookiecutter.processor_type }}/src/main/java/org/elasticsearch/plugin/ingest/{{ cookiecutter.package_dir }}/{{ cookiecutter.processor_type | title | replace("-", "") }}Processor.java: Invalid argument
error: unable to create file ingest-{{ cookiecutter.processor_type }}/src/test/java/org/elasticsearch/plugin/ingest/{{ cookiecutter.package_dir }}/{{ cookiecutter.processor_type | title | replace("-", "") }}ProcessorTests.java: Filename too long
error: unable to create file ingest-{{ cookiecutter.processor_type }}/src/test/java/org/elasticsearch/plugin/ingest/{{ cookiecutter.package_dir }}/{{ cookiecutter.processor_type | title | replace("-", "") }}RestIT.java: Invalid argument
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

I guess it could be somehow addressed by allowing for long paths, see https://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows or maybe filenames could be shortened a bit.

@spinscale
Copy link
Owner

I do not have any windows system to test or patch. Would you be willing to help out with a PR?

@holgerbrandl
Copy link
Author

I'm really sorry, but I don't have enough time to dig into this topic at the moment.

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

No branches or pull requests

2 participants