5

I'm attempting to upload graphs made/edited in Cloud Connect to GoodData via the api. I have been trying to use this call: http://docs.gooddata.apiary.io/#cloudconnectprocesses

The actual call I'm making has the json {"process": {"path": "/uploads/Bonobos_v6-1.grf", "name": "Bonobos Prod"}}

However, when I try to run this, it fails with

{
    "error": {
        "errorClass": "com.gooddata.msf.processes.InvalidProcessException",
        "trace": "",
        "message": "Can not read from file \"/uploads/Bonobos_v6-1.grf\"",
        "component": "MSF",
        "errorId": "83090caa-31c9-4ce2-bb79-040d5c4d2421",
        "errorCode": "gdc1151",
        "parameters": []
    }
}

Is there a specific way of creating a "process" that then needs to get uploaded to the server? I've tried both zip files of multiple graphs and individual .grf files, but to no avail. I'm also assuming that the error does not mean that GoodData can't see the file, but that would certainly explain some things.

Jiri Tobolka
  • 635
  • 3
  • 13
jpavs
  • 648
  • 5
  • 17

3 Answers3

2

Before calling this API you have to upload the packed all files in your CloudConnect project and PUT them on the server. Have you done this?

So the whole process will be:

  1. ZIP archive all files (i.e. workspace.prm) and folders (graphs,meta,trans,...) from CloudConnect Project folder (please do not add data folder if there is a bigger volume of data, store them in external location then)
  2. PUT them on the webdav server (example is na1-di.gooddata.com/uploads/...)
  3. Call the API to Deploy it (the path will be "/uploads/your-folder/name-of-the-archive")

Remember: If you have your Project on https://secure.gooddata.com your webdav server is https://secure-di.gooddata.com/uploads/ if your project is on the https://na1.gooddata.com you have to use https://na1-di.gooddata.com/uploads/

Let me know if this helps you. We need to clarify this info in API docs anyway.

Thanks!

Jiri Tobolka
  • 635
  • 3
  • 13
  • I have already done a PUT with the zip file - that's why I'm confused as to why it isn't working. It is in the /uploads directory. – jpavs Feb 05 '14 at 15:06
  • Let me doublecheck it. I will let you know! – Jiri Tobolka Feb 05 '14 at 15:31
  • Have you uploaded the ZIP file? Because what you sent here says you are calling .grf file but you need to call the ZIP that will be upacked and deployed. – Jiri Tobolka Feb 05 '14 at 15:42
  • I just mentioned I tried both .grf and .zip, to make sure I wasn't doing something incorrectly. I've got these files up there: Archive.zip and sales_v6.grf. It can't read either – jpavs Feb 05 '14 at 18:03
  • OK, and inside the .zip file - were all folders and files from project included? I checked logs and it seems that there is something missing in the file/archive. Or you just zipped one graph? – Jiri Tobolka Feb 05 '14 at 21:35
  • I zipped two graphs, so not everything is there. Do I need to have LDM as well? Or do I just zip up the entire folder from Cloud Connect with the graphs in it? – jpavs Feb 05 '14 at 22:53
  • Yes, I edited the previous answer. Zip complete structure from the CC Project folders, workspace.prm etc. – Jiri Tobolka Feb 06 '14 at 08:53
  • So I've done this (I tried zipping the main folder, and then when that didn't work I went into the main folder and selected all objects and compressed those) - no luck so far. It still says `"Can not read from file \"/uploads/Pantalytics_prod.zip\""` – jpavs Feb 06 '14 at 18:15
  • Did you double checked server? secure vs na1 ? See the latest edit of the response. – Jiri Tobolka Feb 06 '14 at 20:19
  • I've specified na1.di.gooddata.com the whole time. One thing - I'm doing a put this way: sftp @@na1-di.gooddata.com, and then I put the file in the directory uploads. Is that the correct place? – jpavs Feb 06 '14 at 20:21
2

First of all you have to check where is your project located(na1 or secure). If your project resides on na1 follow this procedure:

  1. zip your CloudConnect project (it doesn't matter whether you zip whole folder or just its content)
  2. upload zip file to webdav - na1-di.gooddata.com/uploads using curl curl -k -T zippedCcProject.zip https://my_login%40company.com:my_password@na1-di.gooddata.com/uploads/zippedCcProject.zip
  3. open browser and go to the processes rest resource https://na1.secure.gooddata.com/gdc/projects/{projectId}/dataload/processes/ and fill proper attributes (type=GRAPH, name=myCloudConnectProject, path=/uploads/zippedCcProject.zip) and hit 'create the process'
mawek
  • 679
  • 10
  • 19
  • I followed this process exactly. Result of the curl: `

    Resource /uploads/project.zip has been created.

    `. But when I went to the project in a browser and filled in the required fields, I still get `"errorClass"com.gooddata.msf.processes.InvalidProcessException", "message" : "Can not read from file\"/uploads/Pantalytics_prod.zip\""`
    – jpavs Feb 07 '14 at 16:30
  • In curl result you are mentioning 'project.zip' as uploaded filename, but then when creating process you set 'Pantalytics_prod.zip' as filename. The 'path' attribute has to match uploaded filename. Try to set path to '/uploads/project.zip' – mawek Feb 07 '14 at 16:36
  • Error message '...InvalidProcessException... Can not read from file...' essentially means that backend was not able to read uploaded file from webdav. So either you are uploading it to the wrong webdav(secure) or you are setting wrong file path in 'path' attribute when creating process. – mawek Feb 07 '14 at 16:39
  • I've verified that both urls start with na1, so it can't be that. And I've checked multiple times that the file I'm trying to upload is on the server (through the browser and through command line). Is there any kind of special zip format this needs to be? I used gzip - is that acceptable? – jpavs Feb 07 '14 at 18:47
  • gzip and zip formats are not compatible - I'm not sure I understand how you created zip archive in gzip format with zip extension. Nevertheless, as I mentioned above, error message you are receiving signals that backend can't located file on webdav. Btw, are you sure that you are working with webdav with the same user with which you trying to create process? – mawek Feb 09 '14 at 10:16
  • Turns out the process I had was indeed using a different username. Sorry for so much back and forth, I really appreciate all the help you guys gave here. – jpavs Feb 10 '14 at 22:11
0

As example on how to PUT the file to the webdav server you can use following request:

curl -i -v -X PUT --data-binary @project.zip https://username%40company.com:PASSWORD@na1-di.gooddata.com/uploads/project.zip

You can check if the file is in place by accessing it via web browser. Then you can call the API as specified above.

Jiri Tobolka
  • 635
  • 3
  • 13