У меня возникла проблема с экспортом электронных писем из учетной записи пользователя из Firebase.
Я только что вернулся к старому проекту, к которому не обращался несколько месяцев, и хочу экспортировать адреса электронной почты. Я в своей папке functions
и сделал:
npm install -g firebase-tools
, затем
npm install firebase-functions
и
npm install
Никаких проблем здесь. Затем я ввожу:
firebase auth:export save_file.csv --format=csv
и получаю вывод:
$ firebase auth:export save_file.csv --format=csv
Exporting accounts to save_file.csv
Error: An unexpected error has occurred.
Я также читаю, что вы можете попробовать firebase login --interactive
, но когда я это делаю, я получаю ошибку:
Already logged in as ***@gmail.com
Как мне go отладить это / что мне делать, чтобы экспортировать электронные письма? Есть идеи?
Спасибо.
Редактировать: Я копался в firebase-debug
и вывод показал:
[debug] [2020-01-20T21:49:31.847Z] ----------------------------------------------------------------------
[debug] [2020-01-20T21:49:31.849Z] Command: C:\Program Files\nodejs\node.exe C:\Users\Simon K\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js auth:export save_file.csv --format=csv
[debug] [2020-01-20T21:49:31.849Z] CLI Version: 7.12.1
[debug] [2020-01-20T21:49:31.849Z] Platform: win32
[debug] [2020-01-20T21:49:31.849Z] Node Version: v12.7.0
[debug] [2020-01-20T21:49:31.851Z] Time: Mon Jan 20 2020 16:49:31 GMT-0500 (Eastern Standard Time)
[debug] [2020-01-20T21:49:31.851Z] ----------------------------------------------------------------------
[debug] [2020-01-20T21:49:31.851Z]
[debug] [2020-01-20T21:49:31.857Z] > 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"]
[debug] [2020-01-20T21:49:31.858Z] > authorizing via signed-in user
[debug] [2020-01-20T21:49:31.859Z] [iam] checking project anonymous-social for permissions ["firebase.projects.get","firebaseauth.users.get"]
[debug] [2020-01-20T21:49:31.860Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-01-20T21:49:31.860Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-01-20T21:49:32.050Z] <<< HTTP RESPONSE 400
[debug] [2020-01-20T21:49:32.051Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/anonymous-social:testIamPermissions
[debug] [2020-01-20T21:49:32.183Z] <<< HTTP RESPONSE 401
[debug] [2020-01-20T21:49:32.183Z] <<< HTTP RESPONSE BODY
[debug] [2020-01-20T21:49:32.184Z] [iam] error while checking permissions, command may fail: FirebaseError: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[info] Exporting accounts to save_file.csv
[debug] [2020-01-20T21:49:32.185Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-01-20T21:49:32.185Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-01-20T21:49:32.332Z] <<< HTTP RESPONSE 400
[debug] [2020-01-20T21:49:32.333Z] >>> HTTP REQUEST POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/downloadAccount
[debug] [2020-01-20T21:49:32.457Z] <<< HTTP RESPONSE 401
[debug] [2020-01-20T21:49:32.457Z] <<< HTTP RESPONSE BODY
[debug] [2020-01-20T21:49:32.614Z] TypeError: Cannot read property 'code' of undefined
at C:\Users\Simon K\AppData\Roaming\npm\node_modules\firebase-tools\lib\accountExporter.js:170:26
at processTicksAndRejections (internal/process/task_queues.js:85:5)
[error]
[error] Error: An unexpected error has occurred.
Имеет ли это смысл?