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

Long path error on Windows when using Gradle with JHipster 6.0.0 (similar to Issue #4323) #9713

Closed
sometxdude opened this issue May 9, 2019 · 14 comments · Fixed by #9731
Closed

Comments

@sometxdude
Copy link

sometxdude commented May 9, 2019

It seems like the long path error associated with Windows/Gradle has returned.

Issue #4323 explains the error.

It seems the workaround for this error was removed on April 19th, 2019 in the following commit:
73e50ba#diff-2c3f53e6e847061a8ab6ba212e021632

I'm using Windows 10, and I tried using the registry key modification as mentioned here -> #9572 (comment)

However, I am still getting the "CreateProcess error=206, The filename or extension is too long" message whenever I try to launch my app.

@atomfrede
Copy link
Member

You are right we removed it as it looked like to be okay with Windows 10. Have you checked adding the workaround into your build.gradle to fix the problem ?

@pascalgrimaud
Copy link
Member

As asked by Matt, if you add the deleted code into your build.gradle, does it fix the problem?

If yes, we have different behaviour here, with Windows 10:

  • some users don't need this code otherwise, it will fail
  • some users like you need this code

@atomfrede
Copy link
Member

I really hoped it would be solved with windows 10. Maybe it has something to with a patch release or so?

@sometxdude
Copy link
Author

sometxdude commented May 9, 2019

I tried adding in the snippets that were removed, but I still got an error. My attempts to put a pathingJar or classpathJar task back into the build.gradle have not helped so far. If I am remembering correctly, I ended up with a different error after adding the pathingJar back in. It was saying that java.exe exited with a non-zero exit code, but despite turning on stacktrace and debug args, I couldn't see what java.exe command was executed or the console output from java.exe. So, it seems adding the old snippets back just trades one error for another.

I also double-checked the registry modification workaround, and restarted my PC after enabling LongPaths in Windows. My Windows 10 is fully up to date with patches.

I plan to delve into this issue more today if time permits, and I will report my findings.

@atomfrede
Copy link
Member

@pvliss can you have a look as it works for you without the workaround. Is that still the case?

@sometxdude
Copy link
Author

sometxdude commented May 9, 2019

According to this article, CreateProcess() on Windows has an absolute upper limit of 32767 characters. My java launch command is 35606 characters in length. I think this 32767 figure is a separate limit from the 260 character Path limit. The Windows registry modification appears to remove only the 260 character path limit, but does not fix the hard limit of 32767 characters, so it seems a pathingJar is still needed. I could be wrong about the hard upper limit of 32767 chars being present in Windows 10. Microsoft mentions this limit here, but it doesn't specifically mention Windows 10. My folders aren't nested very deeply and I chose only a few extra libraries for my project, so I have a feeling many more people will run into this problem. I believe a pathingJar is the only solution, so I'm still looking into adding that back.

@pvliss
Copy link
Contributor

pvliss commented May 9, 2019

@sometxdude More details on the problem can be be found at this issue. Since I was not able to reproduce the problem can you please also try the other workarounds referenced there, e.g using the plugin: https://github.com/viswaramamoorthy/gradle-util-plugins or its fork: https://github.com/viswaramamoorthy/gradle-util-plugins

@pvliss
Copy link
Contributor

pvliss commented May 9, 2019

@sometxdude Also, can you share your configuration and any extra dependencies that you might be using which can help us replicate?

@sometxdude
Copy link
Author

sometxdude commented May 9, 2019

@pvliss I tried the plugin at https://github.com/viswaramamoorthy/gradle-util-plugins and it fixed the issue. Thanks for mentioning that. I am leaving my environment info here should anyone need to reproduce the error.

My environment consists of the following:

  • Windows 10 Home version 1809, OS Build 17763.475
  • JDK 11.0.3
  • JHipster 6.0.0 installed via npm
  • Project dir at C:\Users\jsdym\workspace\ideaskeeper

JHipster Answers:
Which type of application would you like to create? Monolithic application (recommended for simple projects)
What is the base name of your application? ideaskeeper
What is your default Java package name? com.ideaskeeper
Do you want to use the JHipster Registry to configure, monitor and scale your application? No
Which type of authentication would you like to use? JWT authentication (stateless, with a token)
Which type of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
Which production database would you like to use? PostgreSQL? Which development database would you like to use? H2 with disk-based persistence
Do you want to use the Spring cache abstraction? Yes, with the Ehcache implementation (local cache, for a single node)

Do you want to use Hibernate 2nd level cache? Yes
Would you like to use Maven or Gradle for building the backend? Gradle
Which other technologies would you like to use? Search engine using Elasticsearch, WebSockets using Spring Websocket
Which Framework would you like to use for the client? React
Would you like to use a Bootswatch theme (https://bootswatch.com/)? Litera
Choose a Bootswatch variant navbar theme (https://bootswatch.com/)? Primary
Would you like to enable internationalization support? No
Besides JUnit and Jest, which testing frameworks would you like to use? (Press to select, to toggle all, <
i> to invert selection)
Would you like to install other generators from the JHipster Marketplace? (y/N) N

Running gradlew.bat from the commandline will then result in a "Createprocess error=206 the filename or extension is too long" error. The https://github.com/viswaramamoorthy/gradle-util-plugins plugin fixes the issue.

@pvliss
Copy link
Contributor

pvliss commented May 9, 2019

@sometxdude Nice to know it works and thanks a lot for the extra info!!! Will try to replicate within the next couple of days

@atomfrede Maybe we should enable the plugin by default instead of the workaround?

@atomfrede
Copy link
Member

@pvliss I will also try to reproduce it over the weekend (my windows is just for gaming so nothing installed yet). If the plugin works we can give it at try, but as seems not to be very well maintained I fear we will have more problems when gradle 6 is released (and we still have some deprecation warnings currently).

@pvliss
Copy link
Contributor

pvliss commented May 10, 2019

@atomfrede You are right. It is not really maintained and this might pose a problem in the future. Will need to revisit the workaround though as it does not work either

@atomfrede
Copy link
Member

@pvliss Going to have look at this tonight

@atomfrede atomfrede self-assigned this May 11, 2019
@atomfrede
Copy link
Member

So the default application works just fine. Adding elastic search and websockets breaks the limit. I have a working solution. Doing a pr tomorrow.

atomfrede added a commit to atomfrede/generator-jhipster that referenced this issue May 12, 2019
atomfrede added a commit to atomfrede/generator-jhipster that referenced this issue May 12, 2019
atomfrede added a commit to atomfrede/generator-jhipster that referenced this issue May 12, 2019
atomfrede added a commit to atomfrede/generator-jhipster that referenced this issue May 13, 2019
@pascalgrimaud pascalgrimaud added this to the 6.1.0 milestone Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants