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

"Couldn't compile the CSS from LESS sources" if plugin is located on network folder #183

Closed
ghost opened this issue Nov 9, 2015 · 7 comments

Comments

@ghost
Copy link

ghost commented Nov 9, 2015

When installing the build monitor plugin on my Jenkins system I receive the following error in the log:

Nov 05, 2015 11:47:03 AM SEVERE jenkins.InitReactorRunner$1 onTaskFailed
Failed Initializing plugin build-monitor-plugin
javax.servlet.ServletException: Couldn't compile the CSS from LESS sources
    at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.init(LessCSS.java:32)
    at hudson.util.PluginServletFilter.addFilter(PluginServletFilter.java:99)
    at com.smartcodeltd.jenkinsci.plugin.assetbundler.Dispatcher.postInitialize(Dispatcher.java:25)
    at hudson.PluginManager$2$1$2.run(PluginManager.java:389)
    at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$7.runTask(Jenkins.java:904)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.github.sommeri.less4j.Less4jException: Could not compile less. 1 error(s) occurred:
ERROR The file \[Host]\[Share]\[Folder]\Jenkins\testjenkins\plugins\build-monitor-plugin\less\index.less does not exists.

    at com.github.sommeri.less4j.core.ThreadUnsafeLessCompiler.toAntlrTree(ThreadUnsafeLessCompiler.java:96)
    at com.github.sommeri.less4j.core.ThreadUnsafeLessCompiler.doCompile(ThreadUnsafeLessCompiler.java:83)
    at com.github.sommeri.less4j.core.ThreadUnsafeLessCompiler.compile(ThreadUnsafeLessCompiler.java:75)
    at com.github.sommeri.less4j.core.ThreadUnsafeLessCompiler.compile(ThreadUnsafeLessCompiler.java:49)
    at com.github.sommeri.less4j.core.DefaultLessCompiler.compile(DefaultLessCompiler.java:50)
    at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.cssFrom(LessCSS.java:61)
    at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.init(LessCSS.java:30)
    ... 11 more

The Jenkins working directory including the plugins is located on a network share, which is accessed by UNC path:
\[Host]\[Share]\[Folder]\Jenkins\testjenkins\plugins\build-monitor-plugin\less\index.less
The path is displayed in the error message with only one leading backslash, instead of two.

If you need more details, please let me know.
Would be great if you could fix that.

@jan-molak
Copy link
Member

Hey @adaubner and thanks for reporting this. What version of java are you running your Jenkins on? And what version of Jenkins do you have?
I'm wondering if the issue you're seeing could be related to a Jenkins bug JENKINS-26203 fixed in Jenkins 1.598.

@ghost
Copy link
Author

ghost commented Nov 17, 2015

Hi Jan.

Since yesterday we are running on Java 8u65.
Before that it was 7u79.

Best regards,

Andreas Daubner
IT/SIS-SYS

Pepperl+Fuchs GmbH
Lilienthalstraße 200
68307 Mannheim
Telefon: +49 621 776-1612

E-Mail: adaubner@de.pepperl-fuchs.commailto:adaubner@de.pepperl-fuchs.com
www.pepperl-fuchs.comhttp://www.pepperl-fuchs.com/

Von: Jan Molak [mailto:notifications@github.com]
Gesendet: Dienstag, 17. November 2015 01:27
An: jan-molak/jenkins-build-monitor-plugin jenkins-build-monitor-plugin@noreply.github.com
Cc: Daubner Andreas ADaubner@de.pepperl-fuchs.com
Betreff: Re: [jenkins-build-monitor-plugin] "Couldn't compile the CSS from LESS sources" if plugin is located on network folder (#183)

Hey @adaubnerhttps://github.com/adaubner and thanks for reporting this. What version of java are you running your Jenkins on?


Reply to this email directly or view it on GitHubhttps://github.com//issues/183#issuecomment-157219089.

[e-news abonnieren]http://www.pepperl-fuchs.de/e-news [YouTube: Pepperl+Fuchs auf YouTube] http://www.youtube.com/user/PepperlFuchsGmbH [@PepperlFuchsDE folgen] https://twitter.com/PepperlFuchsDE [Pepperl+Fuchs auf XING] https://www.xing.com/companies/pepperl%252bfuchsgmbh


[Pepperl+Fuchs GmbH]http://www.pepperl-fuchs.com

SocialMedia2014

Pepperl+Fuchs GmbH, Mannheim
Geschaeftsfuehrer/Managing Directors: Dr.-Ing. Gunther Kegel (Vors./CEO), Dr.-Ing. Peter Adolphs, Werner Guthier, Mehmet Hatiboglu
Vorsitzender des Aufsichtsrats/Chairman of the supervisory board: Claus Michael
Registergericht/Register Court: AG Mannheim HRB 4713.

Wichtiger Hinweis:
Diese E-Mail einschliesslich ihrer Anhaenge enthaelt vertrauliche und rechtlich geschuetzte Informationen, die nur fuer den Adressaten bestimmt sind. Sollten Sie nicht der bezeichnete Adressat sein, so teilen Sie dies bitte dem Absender umgehend mit und loeschen Sie diese Nachricht und ihre Anhaenge. Die unbefugte Weitergabe, das Anfertigen von Kopien und jede Veraenderung der E-Mail ist untersagt. Der Absender haftet nicht fuer Inhalte von veraenderten E-Mails..
Important Information:
This e-mail message including its attachments contains confidential and legally protected information solely intended for the addressee. If you are not the intended addressee of this message, please contact the addresser immediately and delete this message including its attachments. The unauthorized dissemination, copying and change of this e-mail are strictly forbidden. The addresser shall not be liable for the content of such changed e-mails.

@jan-molak
Copy link
Member

@adaubner - would you like to check if the latest version - 1.6+build.168 - resolved the issue for you?

Two things worth noting:

  • the fix requires Build Monitor to run on Jenkins 1.598 or later (due to a bug in Jenkins)
  • and Jenkins to run on Java 7 u60 or later (due to a bug in Java)

Please note: The version of Build Monitor mentioned in this ticket is not yet available on Jenkins Update Centre as it's a "beta" released to gather early feedback (changelog).
To install the plugin from a .hpi file go to Manage Jenkins > Manage Plugins > Advanced > Upload

Looking forward to hearing from you!

Jan

@ghost
Copy link
Author

ghost commented Nov 18, 2015

Hi Jan.

Sorry, it´s not working yet:

Nov 18, 2015 2:15:51 PM jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Initializing plugin build-monitor-plugin
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.(Unknown Source)
at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.(LessCSS.java:24)
at com.smartcodeltd.jenkinsci.plugin.assetbundler.Dispatcher.postInitialize(Dispatcher.java:27)
at hudson.PluginManager$2$1$2.run(PluginManager.java:389)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:904)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

After a short look at google, this has to do with the UNC path. ☹

Best regards,
Andreas

Von: Jan Molak [mailto:notifications@github.com]
Gesendet: Mittwoch, 18. November 2015 01:57
An: jan-molak/jenkins-build-monitor-plugin jenkins-build-monitor-plugin@noreply.github.com
Cc: Daubner Andreas ADaubner@de.pepperl-fuchs.com
Betreff: Re: [jenkins-build-monitor-plugin] "Couldn't compile the CSS from LESS sources" if plugin is located on network folder (#183)

@adaubnerhttps://github.com/adaubner - would you like to check if the latest version - 1.6+build.168https://smartcode-opensource.ci.cloudbees.com/job/jenkins-build-monitor-plugin/168/artifact/target/build-monitor-plugin.hpi - resolved the issue for you?

Two things worth noting:

  • the fix requires Build Monitor to run on Jenkins 1.598 or later (due to a bug in Jenkinshttp://jenkins-ci.org/changelog#v1.598)
  • and Jenkins to run on Java 7 u60 or later (due to a bug in Javahttp://bugs.java.com/view_bug.do?bug_id=8014394)

Please note: The version of Build Monitor mentioned in this ticket is not yet available on Jenkins Update Centre as it's a "beta" released to gather early feedback (changeloghttps://github.com/jan-molak/jenkins-build-monitor-plugin/compare/release-1.6+build.164...release-1.6+build.168).
To install the plugin from a .hpi file go to Manage Jenkins > Manage Plugins > Advanced > Upload

Looking forward to hearing from you!

Jan


Reply to this email directly or view it on GitHubhttps://github.com//issues/183#issuecomment-157562058.

[e-news abonnieren]http://www.pepperl-fuchs.de/e-news [YouTube: Pepperl+Fuchs auf YouTube] http://www.youtube.com/user/PepperlFuchsGmbH [@PepperlFuchsDE folgen] https://twitter.com/PepperlFuchsDE [Pepperl+Fuchs auf XING] https://www.xing.com/companies/pepperl%252bfuchsgmbh


[Pepperl+Fuchs GmbH]http://www.pepperl-fuchs.com

SocialMedia2014

Pepperl+Fuchs GmbH, Mannheim
Geschaeftsfuehrer/Managing Directors: Dr.-Ing. Gunther Kegel (Vors./CEO), Dr.-Ing. Peter Adolphs, Werner Guthier, Mehmet Hatiboglu
Vorsitzender des Aufsichtsrats/Chairman of the supervisory board: Claus Michael
Registergericht/Register Court: AG Mannheim HRB 4713.

Wichtiger Hinweis:
Diese E-Mail einschliesslich ihrer Anhaenge enthaelt vertrauliche und rechtlich geschuetzte Informationen, die nur fuer den Adressaten bestimmt sind. Sollten Sie nicht der bezeichnete Adressat sein, so teilen Sie dies bitte dem Absender umgehend mit und loeschen Sie diese Nachricht und ihre Anhaenge. Die unbefugte Weitergabe, das Anfertigen von Kopien und jede Veraenderung der E-Mail ist untersagt. Der Absender haftet nicht fuer Inhalte von veraenderten E-Mails..
Important Information:
This e-mail message including its attachments contains confidential and legally protected information solely intended for the addressee. If you are not the intended addressee of this message, please contact the addresser immediately and delete this message including its attachments. The unauthorized dissemination, copying and change of this e-mail are strictly forbidden. The addresser shall not be liable for the content of such changed e-mails.

jan-molak added a commit that referenced this issue Nov 18, 2015
… the one applied in SBT: sbt/sbt#564)

Build Monitor should load its LESS CSS assets correctly from a mapped network folder defined as a UNC path on Windows as long as:
- Build Monitor runs on Jenkins 1.598 or later (due to a bug in Jenkins prior to that version: http://jenkins-ci.org/changelog#v1.598)
- Jenkins runs on Java 7 u60 or later (due to a bug in Java prior to that version: http://bugs.java.com/view_bug.do?bug_id=8014394)

Fixes #183
@jan-molak
Copy link
Member

Hey Andreas,

Yes, you're correct. The problem is caused by the Java File class not handling the Windows UNC paths correctly. As mentioned in my previous post, Java 7 update 60 fixed this problem, and if you're using Jenkins >= 1.598 it can use that fix.

Many thanks for reporting the second problem, the one with the authority. This seems to be caused by a different issue with the File class, and the way it's interacting with the URI class... Oh joy ;-)

The latest build (1.6+build.169, available here) should work around that problem. Please give it a try and let me know your thoughts!

Looking forward to hearing from you,
Jan

@ghost
Copy link
Author

ghost commented Nov 19, 2015

Hello Jan.

Good news. The new version works!

Great job.

Best regards,
Andreas

Von: Jan Molak [mailto:notifications@github.com]
Gesendet: Mittwoch, 18. November 2015 23:25
An: jan-molak/jenkins-build-monitor-plugin jenkins-build-monitor-plugin@noreply.github.com
Cc: Daubner Andreas ADaubner@de.pepperl-fuchs.com
Betreff: Re: [jenkins-build-monitor-plugin] "Couldn't compile the CSS from LESS sources" if plugin is located on network folder (#183)

Hey Andreas,

Yes, you're correct. The problem is caused by the Java File class not handling the Windows UNC paths correctly. As mentioned in my previous post, Java 7 update 60 fixed this problem, and if you're using Jenkins >= 1.598 it can use that fix.

Many thanks for reporting the second problem, the one with the authority. This seems to be caused by a different issue with the File class, and the way it's interacting with the URI class... Oh joy ;-)

The latest build (1.6+build.169, available herehttps://smartcode-opensource.ci.cloudbees.com/job/jenkins-build-monitor-plugin/169/artifact/target/build-monitor-plugin.hpi) should work around that problem. Please give it a try and let me know your thoughts!

Looking forward to hearing from you,
Jan


Reply to this email directly or view it on GitHubhttps://github.com//issues/183#issuecomment-157884270.

[e-news abonnieren]http://www.pepperl-fuchs.de/e-news [YouTube: Pepperl+Fuchs auf YouTube] http://www.youtube.com/user/PepperlFuchsGmbH [@PepperlFuchsDE folgen] https://twitter.com/PepperlFuchsDE [Pepperl+Fuchs auf XING] https://www.xing.com/companies/pepperl%252bfuchsgmbh


[Pepperl+Fuchs GmbH]http://www.pepperl-fuchs.com

SocialMedia2014

Pepperl+Fuchs GmbH, Mannheim
Geschaeftsfuehrer/Managing Directors: Dr.-Ing. Gunther Kegel (Vors./CEO), Dr.-Ing. Peter Adolphs, Werner Guthier, Mehmet Hatiboglu
Vorsitzender des Aufsichtsrats/Chairman of the supervisory board: Claus Michael
Registergericht/Register Court: AG Mannheim HRB 4713.

Wichtiger Hinweis:
Diese E-Mail einschliesslich ihrer Anhaenge enthaelt vertrauliche und rechtlich geschuetzte Informationen, die nur fuer den Adressaten bestimmt sind. Sollten Sie nicht der bezeichnete Adressat sein, so teilen Sie dies bitte dem Absender umgehend mit und loeschen Sie diese Nachricht und ihre Anhaenge. Die unbefugte Weitergabe, das Anfertigen von Kopien und jede Veraenderung der E-Mail ist untersagt. Der Absender haftet nicht fuer Inhalte von veraenderten E-Mails..
Important Information:
This e-mail message including its attachments contains confidential and legally protected information solely intended for the addressee. If you are not the intended addressee of this message, please contact the addresser immediately and delete this message including its attachments. The unauthorized dissemination, copying and change of this e-mail are strictly forbidden. The addresser shall not be liable for the content of such changed e-mails.

@jan-molak
Copy link
Member

Excellent! Thanks for your help with testing :-)

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

1 participant