Issue reading data from Firebase

Hi, I’m having an issue reading data from Google Firebase

Receiving error ```
TypeError: Cannot read properties of null (reading ‘error’)

At this point it’s just a simple manual trigger followed by a Google Cloud Realtime Database node

TIA for your assistance.

TypeError: Cannot read properties of null (reading 'error')
    at new NodeApiError (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/errors/node-api.error.js:63:27)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Firebase/RealtimeDatabase/GoogleFirebaseRealtimeDatabase.node.js:182:31)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:696:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53

Information on your n8n setup

  • **n8n version: 1.22.4 (Latest Stable)
  • **Database (default: SQLite):Default
  • **n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): n8n Cloud
  • **Operating system: n8n Pro

Hey @NESIT,

Welcome to the community :cake:

Is the Project Name you have used taken from the list or did you type that in?

Hi Jon and thanks for your response. It’s in the list, and none of the three listed projects work. They all return the same error.

Hey @NESIT,

That is interesting, I have just given it a quick test with a test account and it appears to be working for me.

This matches what I have in the realtime database here

Do you have the Realtime Database enabled for your Google Project? Just to double check as well, Is it the Realtime database you have data in or a Firestore database? Is the region also correct in your credential?

Thanks Jon!

I’m going to check on the region. Our database is accessible as both Firestore and Firebase realtime.

I would use n8n nodes for either one, but it’s only the realtime where I was able to get the OAUTH to authenticate properly.

Thanks for your support,

NESIT

Hey @NESIT,

The oauth should work for both if the api is enabled so there could be an issue with the project on the Google side.

As a test you could try using the http request node to manually call the API endpoint for your table and use the same oauth credentials to see if there is anything special in the response, If you update the example below and replace PROJECT-ID in the URL with your Project ID it will return the top level and we can see if there is anything unexpected.

Thanks Jon, I will try that.

The GCP location is nam5 (us-central), and what I chose in the credentials is us-central1, I think this is a match.

Yeah that sounds right, In that case in the URL for the workflow above I would change the region from europe-west1.firebasedatabase.app to firebaseio.com

Thanks, I tried that and got the following error:
ERROR: The resource you are requesting could not be found

404 - “{\n "error" : "404 Not Found"\n}\n” - { “error” : “404 Not Found” }

Details

Time

1/10/2024, 1:41:24 PM

Item Index: 0

HTTP Code

rejected

Stack

NodeApiError: The resource you are requesting could not be found
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:1547:27)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:696:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53

Hey @NESIT,

That looks like Google is saying it can’t be found so it could be that the ID in the URL is incorrect. I think for me while my project was called test my actual project id was something like test-8ad3-xxxx-yyyy so it could be worth double checking that.

I’ve confirmed that’s the actual projectID

Hey @NESIT,

I guess the question now then is why is Google returning a 404 suggesting it is wrong :thinking: The call being made is a standard API call that Google document so it should be working.