Hi everyone,
I'm currently working on a Google Cloud Function that processes CSV files uploaded to Google Cloud Storage and then loads the data into BigQuery. However, I'm encountering an ENOENT: no such file or directory error when the function tries to access the uploaded file, even though I can confirm that the file exists in the bucket and the correct path is being used.
Here's a summary of the setup and the problem:
Despite all this, the function is still returning the following error in the logs:
Error: ENOENT: no such file or directory, open 'gs://email-data-ctrl/[file_name].csv'
Here’s what I’ve tried so far:
Has anyone encountered a similar issue with Cloud Functions accessing Cloud Storage, and if so, how did you resolve it? Any advice or troubleshooting steps would be greatly appreciated.
Thanks in advance for your help!
Hi @menbitame,
Welcome to Google Cloud Community!
It looks like the ENOENT error could be caused by either a slight delay in the file being available when the Cloud Function triggers or a mismatch in the file path. Even though the file exists, there might be a timing issue or a small problem in how the path is constructed.
Here’s what you can try:
I hope the above information is helpful.