Solr
  1. Solr
  2. SOLR-7309

bin/solr will not run when the solr home path contains a space

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.1, 6.0
    • Component/s: scripts and tools, Server
    • Labels:
      None

      Description

      I thought I spotted some unquoted $SOLR_TIP references in bin/solr with 5.0.0, prompting me to test:

      $ mv solr-5.0.0 solr-5.0.0-with' space'
      $ cd solr-5.0.0-with' space'
      $ ./bin/solr -f
      ./bin/solr: line 1161: [: too many arguments
      ./bin/solr: line 1187: [: /Users/mak/Downloads/solr-5.0.0-with: binary operator expected
      ./bin/solr: line 1194: [: /Users/mak/Downloads/solr-5.0.0-with: binary operator expected
      ./bin/solr: line 1327: cd: /Users/mak/Downloads/solr-5.0.0-with: No such file or directory
      
      Starting Solr on port 8983 from /Users/mak/Downloads/solr-5.0.0-with space/server
      
      Error: Could not find or load main class space.server.logs.solr_gc.log
      
      1. SOLR-7309.patch
        32 kB
        Ramkumar Aiyengar
      2. SOLR-7309.patch
        29 kB
        Ramkumar Aiyengar
      3. SOLR-7309.patch
        21 kB
        Ramkumar Aiyengar

        Activity

        Hide
        Ramkumar Aiyengar added a comment -

        Attached patch, still need to iron out a few quirks, but at least works now in the basic cases..

        Show
        Ramkumar Aiyengar added a comment - Attached patch, still need to iron out a few quirks, but at least works now in the basic cases..
        Hide
        Ramkumar Aiyengar added a comment -

        Attached a revised patch which covers a few more cases, and switches over to use bash arrays where it makes sense..

        Show
        Ramkumar Aiyengar added a comment - Attached a revised patch which covers a few more cases, and switches over to use bash arrays where it makes sense..
        Hide
        Ramkumar Aiyengar added a comment -

        Modify bin/post as well..

        Show
        Ramkumar Aiyengar added a comment - Modify bin/post as well..
        Hide
        ASF subversion and git services added a comment -

        Commit 1669628 from Ramkumar Aiyengar in branch 'dev/trunk'
        [ https://svn.apache.org/r1669628 ]

        SOLR-7309: Make bin/solr, bin/post work when Solr installation directory contains spaces

        Show
        ASF subversion and git services added a comment - Commit 1669628 from Ramkumar Aiyengar in branch 'dev/trunk' [ https://svn.apache.org/r1669628 ] SOLR-7309 : Make bin/solr, bin/post work when Solr installation directory contains spaces
        Hide
        ASF subversion and git services added a comment -

        Commit 1669697 from Ramkumar Aiyengar in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1669697 ]

        SOLR-7309: Make bin/solr, bin/post work when Solr installation directory contains spaces

        Show
        ASF subversion and git services added a comment - Commit 1669697 from Ramkumar Aiyengar in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1669697 ] SOLR-7309 : Make bin/solr, bin/post work when Solr installation directory contains spaces
        Hide
        Ramkumar Aiyengar added a comment -

        Thanks for reporting, Martijn.

        Show
        Ramkumar Aiyengar added a comment - Thanks for reporting, Martijn.
        Hide
        Martijn Koster added a comment -

        I tried the bin/solr from rev 1669697 with a nightly; solr started. Thanks Ramkumar!

        I think there is a minor issue with the patch though.
        If I run with Verbose, GC_TUNE and GC_LOG_OPTS report a single argument:

        mak@crab 553 solr-5.0.0-2015-03-28_18-55-36-with space $ ./bin/solr -V -f 
        Using Solr root directory: /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space
        Using Java: /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java
        java version "1.7.0_71"
        Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
        Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
        Backing up /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/logs/solr.log
        Backing up /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/logs/solr_gc.log
        
        Starting Solr using the following settings:
            JAVA            = /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java
            SOLR_SERVER_DIR = /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server
            SOLR_HOME       = /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/solr
            SOLR_HOST       = 
            SOLR_PORT       = 8983
            STOP_PORT       = 7983
            SOLR_JAVA_MEM   = -Xms512m
            GC_TUNE         = -XX:NewRatio=3
            GC_LOG_OPTS     = -verbose:gc
            SOLR_TIMEZONE   = UTC
        

        whereas it is running with more:

        mak@crab 501 ~ $ ps auxwww | grep XX:NewRatio | grep -v grep
        mak             45844   0.1  0.9  3304748 154920 s001  S+   11:19pm   0:03.62 /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java -server -Xss256k -Xms512m -Xmx512m -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:CMSFullGCsBeforeCompaction=1 -XX:CMSTriggerPermRatio=80 -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/logs/solr_gc.log -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -Dsolr.solr.home=/Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/solr -Dsolr.install.dir=/Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space -jar start.jar OPTIONS=default,rewrite
        
        Show
        Martijn Koster added a comment - I tried the bin/solr from rev 1669697 with a nightly ; solr started. Thanks Ramkumar! I think there is a minor issue with the patch though. If I run with Verbose, GC_TUNE and GC_LOG_OPTS report a single argument: mak@crab 553 solr-5.0.0-2015-03-28_18-55-36-with space $ ./bin/solr -V -f Using Solr root directory: /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space Using Java: /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode) Backing up /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/logs/solr.log Backing up /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/logs/solr_gc.log Starting Solr using the following settings: JAVA = /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java SOLR_SERVER_DIR = /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server SOLR_HOME = /Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/solr SOLR_HOST = SOLR_PORT = 8983 STOP_PORT = 7983 SOLR_JAVA_MEM = -Xms512m GC_TUNE = -XX:NewRatio=3 GC_LOG_OPTS = -verbose:gc SOLR_TIMEZONE = UTC whereas it is running with more: mak@crab 501 ~ $ ps auxwww | grep XX:NewRatio | grep -v grep mak 45844 0.1 0.9 3304748 154920 s001 S+ 11:19pm 0:03.62 /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java -server -Xss256k -Xms512m -Xmx512m -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:CMSFullGCsBeforeCompaction=1 -XX:CMSTriggerPermRatio=80 -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/logs/solr_gc.log -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -Dsolr.solr.home=/Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space/server/solr -Dsolr.install.dir=/Users/mak/Downloads/solr-5.0.0-2015-03-28_18-55-36-with space -jar start.jar OPTIONS=default,rewrite
        Hide
        ASF subversion and git services added a comment -

        Commit 1669969 from Ramkumar Aiyengar in branch 'dev/trunk'
        [ https://svn.apache.org/r1669969 ]

        SOLR-7309: Fix bin/solr verbose output

        Show
        ASF subversion and git services added a comment - Commit 1669969 from Ramkumar Aiyengar in branch 'dev/trunk' [ https://svn.apache.org/r1669969 ] SOLR-7309 : Fix bin/solr verbose output
        Hide
        ASF subversion and git services added a comment -

        Commit 1669970 from Ramkumar Aiyengar in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1669970 ]

        SOLR-7309: Fix bin/solr verbose output

        Show
        ASF subversion and git services added a comment - Commit 1669970 from Ramkumar Aiyengar in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1669970 ] SOLR-7309 : Fix bin/solr verbose output
        Hide
        Ramkumar Aiyengar added a comment -

        Thanks, should be fixed now..

        (seriously, have never figured why any language would design arrays this way... </rant> )

        Show
        Ramkumar Aiyengar added a comment - Thanks, should be fixed now.. (seriously, have never figured why any language would design arrays this way... </rant> )
        Hide
        Martijn Koster added a comment -

        Looks good – thanks!

        Show
        Martijn Koster added a comment - Looks good – thanks!
        Hide
        Timothy Potter added a comment -

        Bulk close after 5.1 release

        Show
        Timothy Potter added a comment - Bulk close after 5.1 release

          People

          • Assignee:
            Ramkumar Aiyengar
            Reporter:
            Martijn Koster
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development