Uploaded image for project: 'Pentaho BA Platform'
  1. Pentaho BA Platform
  2. BISERVER-12695

Repository REST service to rename file returns HTTP 500 even though the action appears to succeed anyway

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Fixed
    • Affects Version/s: 5.4.0.1 GA
    • Fix Version/s: 6.1.0 GA
    • Component/s: None
    • Labels:
      None
    • Story Points:
      0
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.
    • Steps to Reproduce:
      Hide

      1) Create a new file called "new file" in the "/public" folder:

      PUT http://localhost:8080/pentaho/api/repo/files/:public:new%20file

      Response: 200 OK.
      New file is created:

      { "aclNode": "false", "createdDate": "1437831735563", "fileSize": "13", "folder": "false", "hidden": "false", "id": "741b4050-62ab-481b-af28-60996317dbe6", "lastModifiedDate": "1437831735563", "locale": "en", "locked": "false", "name": "new file", "ownerType": "-1", "path": "/public/new file", "title": "new file", "versionId": "1.0", "versioned": "true" }

      2) Rename the newly created file to "renamed file":

      PUT http://localhost:8080/pentaho/api/repo/files/:public:new%20file/rename?newName=renamed%20file

      Response: 500 Internal Server Error
      Message body:

      exception while updating file with id "741b4050-62ab-481b-af28-60996317dbe6"

      Reference number: 67c945cc-4e47-430f-995f-327f15778782

      After these calls there is no error message or stack trace in the pentaho log.

      The file does appear to be renamed though:

      { "aclNode": "false", "createdDate": "1437831735563", "fileSize": "13", "folder": "false", "hidden": "false", "id": "741b4050-62ab-481b-af28-60996317dbe6", "lastModifiedDate": "1437831735563", "locale": "en", "locked": "false", "name": "renamed file", "ownerType": "-1", "path": "/public/renamed file", "title": "renamed file", "versionId": "1.0", "versioned": "true" }

      It is unclear why a 500 response was given, and it is unclear how the message body in response to the rename call should be interpreted.

      Show
      1) Create a new file called "new file" in the "/public" folder: PUT http://localhost:8080/pentaho/api/repo/files/:public:new%20file Response: 200 OK. New file is created: { "aclNode": "false", "createdDate": "1437831735563", "fileSize": "13", "folder": "false", "hidden": "false", "id": "741b4050-62ab-481b-af28-60996317dbe6", "lastModifiedDate": "1437831735563", "locale": "en", "locked": "false", "name": "new file", "ownerType": "-1", "path": "/public/new file", "title": "new file", "versionId": "1.0", "versioned": "true" } 2) Rename the newly created file to "renamed file": PUT http://localhost:8080/pentaho/api/repo/files/:public:new%20file/rename?newName=renamed%20file Response: 500 Internal Server Error Message body: exception while updating file with id "741b4050-62ab-481b-af28-60996317dbe6" Reference number: 67c945cc-4e47-430f-995f-327f15778782 After these calls there is no error message or stack trace in the pentaho log. The file does appear to be renamed though: { "aclNode": "false", "createdDate": "1437831735563", "fileSize": "13", "folder": "false", "hidden": "false", "id": "741b4050-62ab-481b-af28-60996317dbe6", "lastModifiedDate": "1437831735563", "locale": "en", "locked": "false", "name": "renamed file", "ownerType": "-1", "path": "/public/renamed file", "title": "renamed file", "versionId": "1.0", "versioned": "true" } It is unclear why a 500 response was given, and it is unclear how the message body in response to the rename call should be interpreted.

      Description

      The REST call to rename a repository file (http://javadoc.pentaho.com/bi-platform500/webservice500/resource_FileResource.html#path__repo_files_-pathId -_rename.html) results in a HTTP 500 response when applied to a new file that was previously PUT in the repository.

      (rename seems to work without issue on directories and on files that were imported using the upload feature in the "Browse files" perspective.)

        Attachments

          Activity

            People

            Assignee:
            elopes Eduardo Lopes (Inactive)
            Reporter:
            rbouman Roland Bouman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: