1 Reply Latest reply on May 14, 2018 10:52 AM by Irwin Dolobowsky

    [REST API] Publish Data Source with append flag failed for nested project

    Treasure Data

      Issue Summary

      Cannot publish Data Source in append mode (append=true) to an existing Data Source, in a nested Project. REST API returns error:

       

      {
        "error": {
          "summary": "Resource Not Found",
          "detail": "Datasource 'demo_nested' could not be found.",
          "code": "404004"
        }
      }
      

       

      Steps to reproduce

      • Create a nested project, for example: 'project_level_0' (or can be 'Default') -> 'new_project_level_1'
      • Publish Data Source using an Extract file, with project_id as project from step 1
      • Observe ID of new Data Source, call `/api/3.0/sites/<site_id>/datasources/<data_source_id>` and verify that new Data Source belongs to target project (project from step 1)
      • Re-publish extract file to above Data Source with *append* mode, for example:
      projectId : <id_of_project_from_step_1>
      name : <data_source_name_from_step_2>
      type : hyper
      fileSessionId : <upload_file_session_id>
      overwrite : false
      append : true
      
      • Publish request will fail with error:
      {
        "error": {
          "summary": "Resource Not Found",
          "detail": "Datasource 'demo_nested' could not be found.",
          "code": "404004"
        }
      }
      

       

      • Notes:
      1. Does not happen on 1st level of Project
      2. Happens on 2018.1+ (including 2018.2.0, aka. Beta 1), not 10.5

       

      Reproduce bash script

      • Please find attached the bash script and sample .hyper Extract file to reproduce.
      • How to run:
      $ TOKEN="<token>" SITE_ID="<site_id>" PROJECT_ID="<nested_project_id>" DATASOURCE="<any_name>" ./tableau_404004_reproduce.sh
      
      • Expected output: it will show error message on step "# Publish Data Source (Append) ..."
      • Note:
        • If you replace PROJECT_ID with a non-nested project, it will not raise error.
        • token and site_id can be obtained by:

       

      $ curl https://10az.online.tableau.com/api/3.0/auth/signin -H 'Content-Type: application/json' -d '{"credentials": {"name":"<username/email>", "password":"<password>", "site": {"contentUrl":"<site_name>"}}}'