Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Not A Defect
    • Component/s: core
    • Labels:
      None
    • Environment:
      debian

      Description

      The --prefix argument, specified in /etc/default/jenkins, isn't be honoured. When jenkins first starts,

      I get the "please wait while jenkins is getting ready to work" on the correct (prefixed) URL (though /static/* is broken). Once the startup is complete, however, all requests to http://localhost:8080/jenkins return 404:

      ridcully:/var/lib/jenkins# ps aux |grep jenkins
      jenkins 17224 0.0 0.0 3396 516 ? Ss 10:21 0:00 /usr/bin/daemon --name=jenkins --inherit --env=JENKINS_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid – /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/run/jenkins/war --httpPort=8080 --ajp13Port=-1 --prefex=/jenkins
      jenkins 17225 104 4.7 688536 49008 ? Sl 10:21 0:05 /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/run/jenkins/war --httpPort=8080 --ajp13Port=-1 --prefex=/jenkins
      ridcully:/var/lib/jenkins# wget http://localhost:8080/jenkins
      -2011-02-14 10:22:19- http://localhost:8080/jenkins
      Resolving localhost... 127.0.0.1, ::1
      Connecting to localhost|127.0.0.1|:8080... connected.
      HTTP request sent, awaiting response... 404 Not Found
      2011-02-14 10:22:19 ERROR 404: Not Found.

        Activity

        Hide
        felix_petriconi Felix Petriconi added a comment -

        Does not work on Windows Server 2008 SP2 either

        Show
        felix_petriconi Felix Petriconi added a comment - Does not work on Windows Server 2008 SP2 either
        Hide
        rovangju Justin Rovang added a comment -

        Ditto here - Debian Squeeze on latest Jenkins

        x. java -jar jenkins.war --help doesn't list --prefix as an option.
        x. Jenkins seems to completely ignore the value I place in the 'Jenkins URL' in the global config...

        Show
        rovangju Justin Rovang added a comment - Ditto here - Debian Squeeze on latest Jenkins x. java -jar jenkins.war --help doesn't list --prefix as an option. x. Jenkins seems to completely ignore the value I place in the 'Jenkins URL' in the global config...
        Hide
        rovangju Justin Rovang added a comment - - edited

        Turns out adding it to my /etc/default/jenkins file seems to make it work

        Show
        rovangju Justin Rovang added a comment - - edited Turns out adding it to my /etc/default/jenkins file seems to make it work
        Hide
        giffordcheung Gifford Cheung added a comment -

        I am encountering the same problem. I added "--prefix=/jenkins" to JENKINS_ARGS in /etc/default/jenkins
        and I get the same 404 message.

        Show
        giffordcheung Gifford Cheung added a comment - I am encountering the same problem. I added "--prefix=/jenkins" to JENKINS_ARGS in /etc/default/jenkins and I get the same 404 message.
        Hide
        giffordcheung Gifford Cheung added a comment - - edited

        fixed my own problem. I found that my mistake was that I had originally configured apache to forward from
        jenkins to localhost:8180
        which showed the page with broken links.
        instead, after configuring the prefix, i should have forwarded from
        jenkins to localhost:8180/jenkins
        This explains the 404 issue because the old forwarding address goes to nowhere.
        ========================================
        I suggest that prefix is working and that this issue should be closed.
        Also, the example above seems to have a typo "prefex"

        Show
        giffordcheung Gifford Cheung added a comment - - edited fixed my own problem. I found that my mistake was that I had originally configured apache to forward from jenkins to localhost:8180 which showed the page with broken links. instead, after configuring the prefix, i should have forwarded from jenkins to localhost:8180/jenkins This explains the 404 issue because the old forwarding address goes to nowhere. ======================================== I suggest that prefix is working and that this issue should be closed. Also, the example above seems to have a typo "prefex"
        Hide
        evernat evernat added a comment -

        So the first reporter has a typo (prefex instead of prefix). And other reporters have made it work.
        So closing as "not a defect", please reopen this issue or a new one if needed.

        Show
        evernat evernat added a comment - So the first reporter has a typo (prefex instead of prefix). And other reporters have made it work. So closing as "not a defect", please reopen this issue or a new one if needed.
        Hide
        ostraaten Onno van der Straaten added a comment -

        On Windows Server 2008 this still does not work. I’m deploying latest release of Jenkins on Windows 2008 server. Now I want to run jenkins in web context /jenkins so I in my jenkins.xml I added a prefix.
        For example <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "BASE\jenkins.war" --httpPort=8282 --ajp13Port=8283 --prefix=/jenkins</arguments>

        I also tried prefix=jenkins, so without the slash. Both produce same results. There is a 404 on all paths, the old one and the new one.

        I don't think it is possible to run under different web context.

        Show
        ostraaten Onno van der Straaten added a comment - On Windows Server 2008 this still does not work. I’m deploying latest release of Jenkins on Windows 2008 server. Now I want to run jenkins in web context /jenkins so I in my jenkins.xml I added a prefix. For example <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "BASE\jenkins.war" --httpPort=8282 --ajp13Port=8283 --prefix=/jenkins</arguments> I also tried prefix=jenkins, so without the slash. Both produce same results. There is a 404 on all paths, the old one and the new one. I don't think it is possible to run under different web context.
        Hide
        magjac Magnus Jacobsson added a comment -

        I had the exact same problem. It turned out that restarting it with http://localhost:8080/restart didn't restart the daemon that reads the /etc/default/jenkins file. Doing sudo /etc/init.d/jenkins restart made it work.

        After http://localhost:8080/restart it does not use prefix because only java has been restarted, not daemon:

        > ps aux |grep jenkins
        jenkins 5727 0.0 0.0 11996 364 ? Ss Feb21 0:00 /usr/bin/daemon --name=jenkins --inherit --env=JENKINS_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid – /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1
        jenkins 5728 241 7.2 1549816 280136 ? Sl 07:22 3:17 /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1

        Then restart this way:

        > sudo /etc/init.d/jenkins restart

        • Restarting Jenkins Continuous Integration Server jenkins [ OK ]

        It now works because the deamon has been restarted:

        > ps aux | grep jenkins
        jenkins 5290 0.0 0.0 11996 364 ? Ss 07:25 0:00 /usr/bin/daemon --name=jenkins --inherit --env=JENKINS_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid – /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --prefix=/jenkins --httpPort=8080 --ajp13Port=-1
        jenkins 5291 152 3.7 1446928 144288 ? Sl 07:25 0:04 /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --prefix=/jenkins --httpPort=8080 --ajp13Port=-1

        I suggest this issue is resolved and closed.

        Show
        magjac Magnus Jacobsson added a comment - I had the exact same problem. It turned out that restarting it with http://localhost:8080/restart didn't restart the daemon that reads the /etc/default/jenkins file. Doing sudo /etc/init.d/jenkins restart made it work. After http://localhost:8080/restart it does not use prefix because only java has been restarted, not daemon: > ps aux |grep jenkins jenkins 5727 0.0 0.0 11996 364 ? Ss Feb21 0:00 /usr/bin/daemon --name=jenkins --inherit --env=JENKINS_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid – /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1 jenkins 5728 241 7.2 1549816 280136 ? Sl 07:22 3:17 /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1 Then restart this way: > sudo /etc/init.d/jenkins restart Restarting Jenkins Continuous Integration Server jenkins [ OK ] It now works because the deamon has been restarted: > ps aux | grep jenkins jenkins 5290 0.0 0.0 11996 364 ? Ss 07:25 0:00 /usr/bin/daemon --name=jenkins --inherit --env=JENKINS_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid – /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --prefix=/jenkins --httpPort=8080 --ajp13Port=-1 jenkins 5291 152 3.7 1446928 144288 ? Sl 07:25 0:04 /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --prefix=/jenkins --httpPort=8080 --ajp13Port=-1 I suggest this issue is resolved and closed.
        Hide
        evernat evernat added a comment -

        As suggested in the latest comment, this issue is supposed to be resolved by participants.

        Show
        evernat evernat added a comment - As suggested in the latest comment, this issue is supposed to be resolved by participants.

          People

          • Assignee:
            ostraaten Onno van der Straaten
            Reporter:
            evilchili evilchili
          • Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: