[CONTROLLER-1] run.sh does not correctly handle pathnames containing " " characters Created: 23/Mar/13 Updated: 19/Oct/17 Resolved: 05/May/15 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | adsal |
| Affects Version/s: | 0.4.0 |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Ed Warnicke | Assignee: | Venkata Siva Vijayendra Bhamidipati |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Mac OS |
||
| External issue ID: | 3 |
| Description |
|
If somewhere in the full path for the location where you are trying to run your controller, you have a path segment with a space, for example: /tmp/Development Stuff/distribution.opendaylight-0.1.0-SNAPSHOT-osgipackage/opendaylight (note the " " in "Development Stuff" above) When you try to execute run.sh, it will fail with the message: usage: dirname path This failure is occurring due to mishandling of the space in "Development Stuff" Still working on fixing... but wanted folks to know ASAP that the workaround is mv /tmp/Development\ Stuff/ /tmp/DevelopmentStuff in other words, kill the space in the path segment. |
| Comments |
| Comment by Venkata Siva Vijayendra Bhamidipati [ 21/Dec/13 ] |
|
I see that this issue still exists on the controller trunk, and this looked like a relatively easy starter bug (Today is my first day working with opendaylight), so am assigning this to myself. I've patched run.sh to get over the spaces issue, and with that, the NoClassDefFoundError goes away, but I'm still running into an issue with the way the URIParser.parse() routine is being called - looks like it cannot parse file URIs when spaces exist in the path: BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US !ENTRY org.eclipse.osgi 4 0 2013-12-20 09:26:14.716 There are more stack traces at different points in the code that are invoked by different libraries - for example, the above is invoked by the "gogo" package, it repeats later with another trace: 2013-12-20 09:29:37 PST [org.apache.catalina.startup.ContextConfig] SEVERE org.apache.catalina.startup.ContextConfig getWebXmlSource Error processed default web.xml named conf/web.xml at /home/cloud/work/new nd/controller/opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/conf/web.xml . Is this OSGI related? Is it possible that the OSGI package being used is outdated and later versions do the parsing correctly (either encode spaces to %20 or call another routine)? Any idea what this glue component/jar is and how I can update its version? I do see in the run.sh file itself, CLASSPATH and FWCLASSPATH variables being initialized to eclipse jar files, but I have little idea of how OSGI works or how the jar components are updated. Thanks! |
| Comment by Ed Warnicke [ 23/Dec/13 ] |
|
You are completely awesome for picking this up In a URI, you must substitute %20 for " " a space character. And example of how to do this kind of substitution from the shell would be: echo "This is a string" | sed 's/ /%20/g' And thank you so much for picking this up |
| Comment by Venkata Siva Vijayendra Bhamidipati [ 24/Dec/13 ] |
|
Thanks Ed! The %20 encoding should be done somewhere in the java layers, but looking at the stack traces, it doesn't look like we can do that in the controller code. Ideally, the call to java.net.URL.toURI(URL.java:938) that is being made, should be encoding those spaces, or handling it differently. So that's where I'm kind of stuck, since I don't know if those OSGI/gogo modules were actually patched later on to fix this, and if so, how we can upgrade those dependencies in the controller packaging. |
| Comment by Venkata Siva Vijayendra Bhamidipati [ 21/Jan/14 ] |
|
The fix has been merged to master - however, the osgi bundles will still need to be updated. I'm marking this bug as fixed for now with this caveat. |
| Comment by Carol Sanders [ 05/May/15 ] |
|
This bug is part of the project to Move all ADSAL associated component bugs to ADSAL. |