n8n icon indicating copy to clipboard operation
n8n copied to clipboard

NocoDB API Change since version 0,9

Open lubeda opened this issue 2 years ago • 12 comments

the nocodb node isn't working with nocodb Version from 0.9

the nocodb api changed with the new version see here https://all-apis.nocodb.com/#tag/DB-table-row and here https://github.com/nocodb/nocodb/issues/1564

lubeda avatar Apr 21 '22 17:04 lubeda

Hey @lubeda,

It looks like a PR has been submitted to resolve this here #3146 it won't help with the old URLs not working but it will mean you should be able to use the newer paths.

Joffcom avatar Apr 22 '22 11:04 Joffcom

Looks like there is a fix prepared for NocoDB here: https://github.com/nocodb/nocodb/issues/1831 which is handy.

Joffcom avatar Apr 22 '22 15:04 Joffcom

Hey @lubeda,

It looks like v0.90.7 of NocoDB should now work with the older APIs although it looks like the data structure has changed so you may need to update your workflow a bit.

I think we can mark this one as solved for now as the initial issue is solved for now, What do you think?

Joffcom avatar Apr 27 '22 10:04 Joffcom

@Joffcom I have tested with the docker NocoDB v0.90.8 today. It seems that NocoDB node is able to GET data, however when I try to update the database I still see error:

{
   "name":"NodeApiError",
   "cause":{
      "message":"404 - \"<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n<head>\\n<meta charset=\\\"utf-8\\\">\\n<title>Error</title>\\n</head>\\n<body>\\n<pre>Cannot PUT /nc/n8n_multilang_bot_wzhb/api/v1/TG_users/bulk</pre>\\n</body>\\n</html>\\n\"",
      "name":"Error",
      "stack":"Error: Request failed with status code 404\n    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:538:35)\n    at endReadableNT (node:internal/streams/readable:1345:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)"
   },
   "node":{
      "parameters":{
         "resource":"row",
         "operation":"update",
         "projectId":"n8n_multilang_bot_wzhb",
         "table":"TG_users",
         "id":"={{$node[\"CheckUser\"].json[\"id\"]}}",
         "dataToSend":"defineBelow",
         "fieldsUi":{
            "fieldValues":[
               {
                  "fieldName":"TG_account_ID",
                  "binaryData":false,
                  "fieldValue":"={{$node[\"chatID\"].json[\"chatID\"]}}"
               },
               {
                  "fieldName":"Last_language_used",
                  "binaryData":false,
                  "fieldValue":"={{$node[\"Telegram Trigger\"].json[\"message\"][\"from\"][\"language_code\"]}}"
               }
            ]
         }
      },
      "name":"UpdateUser",
      "type":"n8n-nodes-base.nocoDb",
      "typeVersion":1,
      "position":[
         1100,
         380
      ],
      "notesInFlow":true,
      "credentials":{
         "nocoDb":{
            "id":"13",
            "name":"NocoDB n8n multilang bot"
         }
      }
   },
   "timestamp":1651138686064,
   "message":"The resource you are requesting could not be found",
   "httpCode":"404",
   "description":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot PUT /nc/n8n_multilang_bot_wzhb/api/v1/TG_users/bulk</pre>\n</body>\n</html>\n"
}

ed-parsadanyan avatar Apr 28 '22 09:04 ed-parsadanyan

Hey @ed-parsadanyan,

Looks like there could still be an issue with the API then, I will set up a new Nocodb instance locally on the latest release and test it.

Joffcom avatar Apr 28 '22 09:04 Joffcom

@ed-parsadanyan : till the new PR gets merged. If you want to, you can please use our new APIs via http. I see you are trying to do a bulk update.

o1lab avatar May 02 '22 14:05 o1lab

I confirm that issue still exists. HTTP requests work fine, but the NocoDB node does not.

NocoDB version: 0.91.0

dominik-mukrecki avatar May 24 '22 04:05 dominik-mukrecki

Hey @dominikmukrecki,

That is to be expected, We are waiting on an internal process to manage different API versions in a cleaner way. In the past we have been doing it as part of the credential and as this is starting to happen more often we want to come up with an approach that will work now and in the future so we have a standard process for it.

For now the best approach would be to use the HTTP Request node.

Joffcom avatar May 24 '22 08:05 Joffcom

@Joffcom any progress on this one?

Zapfmeister avatar Jul 12 '22 13:07 Zapfmeister

Hey @Zapfmeister,

Yes there have been a few more tweaks to the PR opened and it is now in the final review stage so unless anything urgent pops up it will hopefully be in one of the next releases

Joffcom avatar Jul 22 '22 08:07 Joffcom

In version 0.187.2 Node works, but the filter parameters do not work

the request is sent do old api endpoint.

GET /nc/p_mdq0kuqlah85ls/api/v1/leads?where=%28email%2Cneq%2Cnull%29&limit=50

luizeof avatar Jul 24 '22 03:07 luizeof

@luizeof in theory the node only partially supports newer versions of NocoDB. The API routes were changed and the PR we have open brings in support for the newer URIs.

Joffcom avatar Jul 24 '22 06:07 Joffcom

The behavior I see is: I can get or list data, but updates fail silently. Even if I just make the simplest node and hard-code an ID and a single column to set, the component reports success, but no data is changed in NocoDB.

zblesk avatar Sep 30 '22 13:09 zblesk

Hey @zblesk,

Could you pop open a new issue for that one and include your n8n version and nocodb version?

Joffcom avatar Sep 30 '22 15:09 Joffcom

Looks like we forgot to close this one, The changes for 0.90.0 were released in 0.189.0

Joffcom avatar Oct 05 '22 08:10 Joffcom