Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions config export failing with unexpected error #7036

Open
tahir606 opened this issue Apr 23, 2024 · 4 comments · May be fixed by #7047
Open

Functions config export failing with unexpected error #7036

tahir606 opened this issue Apr 23, 2024 · 4 comments · May be fixed by #7047

Comments

@tahir606
Copy link

[REQUIRED] Environment info

firebase-tools: 13.7.3

Platform: macOS

[REQUIRED] Steps to reproduce

Running the command firebase functions:config:export throws the error

[REQUIRED] Expected behavior

The config variables should be exported

[REQUIRED] Actual behavior

Error output:

[info] i  Importing configs from projects: [teamapps, single-station-364002, teamapps-france, teamapps-uat] 
[debug] [2024-04-23T16:36:25.867Z] TypeError: Cannot read properties of undefined (reading 'replace')
    at escape (/Users/tahirshakir/.nvm/versions/node/v18.16.1/lib/node_modules/firebase-tools/lib/functions/runtimeConfigExport.js:128:14)
    at /Users/tahirshakir/.nvm/versions/node/v18.16.1/lib/node_modules/firebase-tools/lib/functions/runtimeConfigExport.js:131:65
    at Array.map (<anonymous>)
    at Object.toDotenvFormat (/Users/tahirshakir/.nvm/versions/node/v18.16.1/lib/node_modules/firebase-tools/lib/functions/runtimeConfigExport.js:131:24)
    at /Users/tahirshakir/.nvm/versions/node/v18.16.1/lib/node_modules/firebase-tools/lib/commands/functions-config-export.js:110:56
    at Array.map (<anonymous>)
    at Command.actionFn (/Users/tahirshakir/.nvm/versions/node/v18.16.1/lib/node_modules/firebase-tools/lib/commands/functions-config-export.js:110:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[error] 
[error] Error: An unexpected error has occurred.

@google-oss-bot
Copy link
Contributor

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@aalej
Copy link
Contributor

aalej commented Apr 24, 2024

Hey @tahir606, thanks for reaching out and sharing your debug logs. I’m able to reproduce the error you mentioned. From what I can gather, it occurs when at least one of your env variables doesn’t have a value set, resulting in it being undefined. I’ll raise this to our engineering team to see what we can do here.

@tahir606
Copy link
Author

Thanks @aalej, That is great to know. What would be the solution here? Setting a value to the env variable? And if so how can I find out which one is it?

Because when I do firebase:config:get I get the complete object with all the envs.

@aalej
Copy link
Contributor

aalej commented Apr 24, 2024

That's interesting, I was under the assumption that firebase:config:get was returning something like:

{
  ...
  "my": {
    "test": {}
  }
  ...
}

Got the config above by running firebase functions:config:set my.test.id=. Setting the value of the variable should fix the issue. Any chance you could share an overview of the output of running firebase:config:get? Please change the string values in the output to remove any personal identifiable information.

@aalej aalej linked a pull request Apr 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants