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

remoteconfig:get -o isn't working #3559

Closed
MartinJLee opened this issue Jul 8, 2021 · 6 comments · Fixed by #3945
Closed

remoteconfig:get -o isn't working #3559

MartinJLee opened this issue Jul 8, 2021 · 6 comments · Fixed by #3945

Comments

@MartinJLee
Copy link

[REQUIRED] Environment info

firebase-tools: 9.14.0 & 9.13.0
can confirm it is working till version 9.12.0

Platform: macOS m1

[REQUIRED] Test case

Downloading remoteconfig

[REQUIRED] Steps to reproduce

run

$ firebase remoteconfig:get -o 'test.json'

[REQUIRED] Expected behavior

remote config template should be downloaded to the 'test.json' file

[REQUIRED] Actual behavior

Error: An unexpected error has occurred.

@MartinJLee MartinJLee changed the title remoteconfig:get -o options isn't working remoteconfig:get -o isn't working Jul 8, 2021
@samtstern
Copy link
Contributor

@MartinJLee can you run the same command with the --debug flag and show the logs?

@samtstern samtstern added the Needs: Author Feedback Issues awaiting author feedback label Jul 12, 2021
@google-oss-bot
Copy link
Contributor

Hey @MartinJLee. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@MartinJLee
Copy link
Author

➜  firebase-management git:(master) ✗ firebase --version
9.16.0
➜  firebase-management git:(master) ✗ firebase remoteconfig:get -o 'test.json'

Error: An unexpected error has occurred.
➜  firebase-management git:(master) ✗ firebase remoteconfig:get -o 'test.json' --debug
[2021-07-21T01:07:53.388Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
...
[2021-07-21T01:07:53.966Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 21 Jul 2021 01:07:53 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=190","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2021-07-21T01:07:54.014Z] AssertionError [ERR_ASSERTION]: expected "string" but got "undefined"
    at new AssertionError (internal/assert.js:269:11)
    at Object.assertIsString (/Users/mlee/.nvm/versions/node/v10.23.0/lib/node_modules/firebase-tools/lib/utils.js:339:15)
    at Command.module.exports.command_1.Command.description.option.option.before.before.action [as actionFn] (/Users/mlee/.nvm/versions/node/v10.23.0/lib/node_modules/firebase-tools/lib/commands/remoteconfig-get.js:29:11)
    at /Users/mlee/.nvm/versions/node/v10.23.0/lib/node_modules/firebase-tools/lib/command.js:171:25
    at process._tickCallback (internal/process/next_tick.js:68:7)

Error: An unexpected error has occurred.

Having trouble? Try again or contact support with contents of firebase-debug.log
[debug] [2021-07-21T01:07:53.234Z] ----------------------------------------------------------------------
[debug] [2021-07-21T01:07:53.237Z] Command:       /Users/mlee/.nvm/versions/node/v10.23.0/bin/node /Users/mlee/.nvm/versions/node/v10.23.0/bin/firebase remoteconfig:get -o test.json --debug
[debug] [2021-07-21T01:07:53.238Z] CLI Version:   9.16.0
[debug] [2021-07-21T01:07:53.238Z] Platform:      darwin
[debug] [2021-07-21T01:07:53.238Z] Node Version:  v10.23.0
[debug] [2021-07-21T01:07:53.239Z] Time:          Wed Jul 21 2021 11:07:53 GMT+1000 (Australian Eastern Standard Time)
[debug] [2021-07-21T01:07:53.239Z] ----------------------------------------------------------------------

@ggirotto
Copy link

If the version is specified, it works as expected: firebase remoteconfig:get -o 'test.json' -v <VERSION>, although it would be nice to the CLI use the latest available version when it's not specified.

The CLI is probably trying to get a version but is receiving undefined

@rockerhieu
Copy link

According to the manual all options should be optional. This is definitely a bug:

Usage: firebase remoteconfig:get [options]

get a Firebase project's Remote Config template

Options:
  -v, --version-number <versionNumber>  grabs the specified version of the template
  -o, --output [filename]               write config output to a filename (if
                                        omitted, will use the default file path)
  -h, --help                            output usage information

@bkendall
Copy link
Contributor

Yup, I found what the issue was. PR inbound. Thanks, and sorry this took so long to get to.

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.

6 participants