Skip to content

[JENKINS-2670] Error 404 for multi-configuration projects when values contains a slash '/' #342

Closed

Description

@jenkins-infra-bot

For multi-configuration projects where the values for a axis contains a slash
'/' a Error 404 occures when a link is clicked which refers to the build status
for that specifc build. The build exists and can be found in the jobs-directory
with log files and success status etc. Thus the build is successfull but cannot
be viewed via the web-interface.

=== Example ===
Build-axis name: foo
Build-axis values (foo): foo.txt dir1/foo.txt dir2/foo.txt

In this case links refering to axis foo with value foo.txt will work. The other
two will give "Error 404". The link gets the form:
http://server:port/view/viewname/jobname/foo=foo.txt
http://server:port/view/viewname/jobname/foo=dir1/foo.txt
http://server:port/view/viewname/jobname/foo=dir2/foo.txt

=== Updated Environment (after reopening issue) ===
Hudson: 1.580.1
Java: java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
Browser: Firefox 33.1


Originally reported by tesandro, imported from: Error 404 for multi-configuration projects when values contains a slash '/'
  • assignee: mindless
  • status: Resolved
  • priority: Major
  • component(s): matrix-project-plugin
  • resolution: Fixed
  • resolved: 2014-12-01T10:40:51+00:00
  • votes: 0
  • watchers: 2
  • imported: 2025-12-06
Raw content of original issue

For multi-configuration projects where the values for a axis contains a slash '/' a Error 404 occures when a link is clicked which refers to the build status for that specifc build. The build exists and can be found in the jobs-directory with log files and success status etc. Thus the build is successfull but cannot be viewed via the web-interface.

=== Example === Build-axis name: foo Build-axis values (foo): foo.txt dir1/foo.txt dir2/foo.txt

In this case links refering to axis foo with value foo.txt will work. The other two will give "Error 404". The link gets the form: http://server:port/view/viewname/jobname/foo=foo.txt http://server:port/view/viewname/jobname/foo=dir1/foo.txt http://server:port/view/viewname/jobname/foo=dir2/foo.txt

=== Updated Environment (after reopening issue) === Hudson: 1.580.1 Java: java version "1.6.0_27" OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1) Browser: Firefox 33.1

  • environment: Platform: PC, OS: Linux
1 attachment

Activity

  1. jenkins-infra-bot commented on Dec 23, 2008

    @jenkins-infra-bot
    Author
    dvrzalik:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      Hi, just trying to catch up ... is this issue related to the build-publisher plugin? E.g. can you observe this behaviour only after build has been published? (You can also point me to a thread on the user list, if I missed any)

      Thanks

      P.S. I am on vacation till Jan 5th

    Hi,
    just trying to catch up ... is this issue related to the build-publisher plugin?
    E.g. can you observe this behaviour only after build has been published? (You
    can also point me to a thread on the user list, if I missed any)

    Thanks

    P.S. I am on vacation till Jan 5th

  2. jenkins-infra-bot commented on Feb 5, 2009

    @jenkins-infra-bot
    Author
    mindless:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      setting subcomponent to "matrix".. I tried this, build-publisher doesn't seem related.

    setting subcomponent to "matrix".. I tried this, build-publisher doesn't seem
    related.

  3. jenkins-infra-bot commented on Feb 5, 2009

    @jenkins-infra-bot
    Author
    mindless:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      unassigning myself from this one.. it's more involved than I have time for. here's what I found:

      1) AbstractItem.getShortUrl() just uses getName() right in the URL, so it assumes item names are always URL-safe.. clearly not so for matrix jobs, where the URL contains PARAM=VALUE and those could be anything.

      2) I put an override of getShortUrl in MatrixConfiguration that uses Util.rawEncode(getName()) instead.. this made a URL like /job/my-job/MyParam=test%2Fslash/ However, maybe stapler doesn't handle this well.. when MatrixProject.getDynamic is called it receives token = "MyParam=test".. it seems stapler decoded %2F into / and still treated it as a path separator, rather than "MyParam=test/slash" being one token.

      3) Matrix job also uses the axis value for storing on the filesystem, so it wrote stuff into configurations/axis-MyParam/test/slash/ directory.. this extra depth (2 levels under axis-MyParam instead of one) seems to confuse things, as the status for these items shows "Pending" instead of "Success".

      4) MatrixProject/ajaxMatrix.jelly and MatrixBuild/ajaxMatrix.jelly use different sources for the URL, so each should be fixed up.

      Hope this helps....

    unassigning myself from this one.. it's more involved than I have time for.
    here's what I found:

    1) AbstractItem.getShortUrl() just uses getName() right in the URL, so it
    assumes item names are always URL-safe.. clearly not so for matrix jobs, where
    the URL contains PARAM=VALUE and those could be anything.

    2) I put an override of getShortUrl in MatrixConfiguration that uses
    Util.rawEncode(getName()) instead.. this made a URL like
    /job/my-job/MyParam=test%2Fslash/
    However, maybe stapler doesn't handle this well.. when
    MatrixProject.getDynamic is called it receives token = "MyParam=test".. it seems
    stapler decoded %2F into / and still treated it as a path separator, rather than
    "MyParam=test/slash" being one token.

    3) Matrix job also uses the axis value for storing on the filesystem, so it
    wrote stuff into configurations/axis-MyParam/test/slash/ directory.. this extra
    depth (2 levels under axis-MyParam instead of one) seems to confuse things, as
    the status for these items shows "Pending" instead of "Success".

    4) MatrixProject/ajaxMatrix.jelly and MatrixBuild/ajaxMatrix.jelly use different
    sources for the URL, so each should be fixed up.

    Hope this helps....

  4. jenkins-infra-bot commented on Aug 30, 2009

    @jenkins-infra-bot
    Author
    mindless:

    taking another crack at this one

  5. jenkins-infra-bot commented on Aug 30, 2009

    @jenkins-infra-bot
    Author
    mindless:

    I filed STAPLER-8 (https://stapler.dev.java.net/issues/show_bug.cgi?id=8) to
    make this fix possible, and I have local changes ready to commit to fix things
    on the Hudson side.

  6. jenkins-infra-bot commented on Aug 30, 2009

    @jenkins-infra-bot
    Author
    mindless:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      Created an attachment (id=877) Proposed fix

    Created an attachment (id=877)
    Proposed fix

  7. jenkins-infra-bot commented on Aug 31, 2009

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in stapler
    User: : mindless
    Path:
    trunk/stapler/core/src/main/java/org/kohsuke/stapler/AncestorImpl.java
    https://stapler.dev.java.net/source/browse/stapler/trunk/stapler/core/src/main/java/org/kohsuke/stapler/AncestorImpl.java?view=diff&rev=1102&p1=trunk/stapler/core/src/main/java/org/kohsuke/stapler/AncestorImpl.java&p2=trunk/stapler/core/src/main/java/org/kohsuke/stapler/AncestorImpl.java&r1=1101&r2=1102
    trunk/stapler/core/src/main/java/org/kohsuke/stapler/Stapler.java
    https://stapler.dev.java.net/source/browse/stapler/trunk/stapler/core/src/main/java/org/kohsuke/stapler/Stapler.java?view=diff&rev=1102&p1=trunk/stapler/core/src/main/java/org/kohsuke/stapler/Stapler.java&p2=trunk/stapler/core/src/main/java/org/kohsuke/stapler/Stapler.java&r1=1101&r2=1102
    trunk/stapler/core/src/main/java/org/kohsuke/stapler/TokenList.java
    https://stapler.dev.java.net/source/browse/stapler/trunk/stapler/core/src/main/java/org/kohsuke/stapler/TokenList.java?view=diff&rev=1102&p1=trunk/stapler/core/src/main/java/org/kohsuke/stapler/TokenList.java&p2=trunk/stapler/core/src/main/java/org/kohsuke/stapler/TokenList.java&r1=1101&r2=1102

    Log:
    [FIXED STAPLER-8] In looking at JENKINS-2670 I found that stapler did not recognize
    the difference between abc/def and abc%2Fdef in a url.. it would always try to map
    the request to "abc" instead of "abc/def" as a single entity.

  8. jenkins-infra-bot commented on Sep 1, 2009

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/Util.java trunk/hudson/main/core/src/main/java/hudson/matrix/MatrixBuild.java trunk/hudson/main/core/src/main/java/hudson/matrix/MatrixProject.java trunk/hudson/main/core/src/main/java/hudson/model/AbstractItem.java trunk/hudson/main/core/src/main/resources/hudson/matrix/MatrixBuild/ajaxMatrix.jelly http://fisheye4.cenqua.com/changelog/hudson/?cs=21321 Log: [FIXED JENKINS-2670] Matrix project includes axis values in URLs.. add encoding when needed for characters in these values, particularly /

    Code changed in hudson
    User: : mindless
    Path:
    trunk/hudson/main/core/src/main/java/hudson/Util.java
    trunk/hudson/main/core/src/main/java/hudson/matrix/MatrixBuild.java
    trunk/hudson/main/core/src/main/java/hudson/matrix/MatrixProject.java
    trunk/hudson/main/core/src/main/java/hudson/model/AbstractItem.java
    trunk/hudson/main/core/src/main/resources/hudson/matrix/MatrixBuild/ajaxMatrix.jelly
    http://fisheye4.cenqua.com/changelog/hudson/?cs=21321
    Log:
    [FIXED JENKINS-2670] Matrix project includes axis values in URLs..
    add encoding when needed for characters in these values, particularly /

  9. jenkins-infra-bot commented on Nov 21, 2014

    @jenkins-infra-bot
    Author
    krizleebear:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      I just observed exactly this issue with Jenkins LTS version 1.580.1 Do you need more information on this? I'm happy to help.

    I just observed exactly this issue with Jenkins LTS version 1.580.1
    Do you need more information on this? I'm happy to help.

  10. jenkins-infra-bot commented on Dec 1, 2014

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Comment link
    • Original comment link (no redirect)
    • Raw content of original comment:

      Please check existing issues before reopening unrelated ones

    Please check existing issues before reopening unrelated ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions