Ожидается
Определенный каталог облачного хранилища Firebase gs://my-project-name.appspot.com/
, который будет заполнен всеми коллекциями в базе данных Firestore my-project-name
, когда развернутое задание Cron запущено на GCP с реализацией, за которой следует График экспорта данных документация.
Наблюдение
Задание Cron успешно развернуто, но не запускается.Журналы показывают Error code 204
.
![screen shot 2019-01-24 at 11 24 13 am](https://user-images.githubusercontent.com/3938076/51703347-f6718380-1fca-11e9-811c-5f82d12e3196.png)
Журналы
2019-01-24 11:19:47.818 PST GET 500 0 B 998 ms AppEngine-Google; (+http://code.google.com/appengine) /cloud-firestore-export?outputUriPrefix=gs://[my-project-name].appspot.com/backups/ 0.1.0.1 - - [24/Jan/2019:11:19:47 -0800] "GET /cloud-firestore-export?outputUriPrefix=gs://[my-project-name].appspot.com/backups/ HTTP/1.1" 500 - - "AppEngine-Google; (+http://code.google.com/appengine)" "cloud-firestore-admin.[my-project-name].appspot.com" ms=998 cpu_ms=482 cpm_usd=0 loading_request=1 instance=00c61b117c5fba456c9edcc5f075ccacb339b96d0bc7a8e35beb60cd3fd50a149d4c2f296b app_engine_release=1.9.71 trace_id=65811179272fc9c721d10e6cab7cdf70
{
httpRequest: {
status: 500
}
insertId: "5c4a0fd4000c78b4e510bd7a"
labels: {
clone_id: "00c61b117c5fba456c9edcc5f075ccacb339b96d0bc7a8e35beb60cd3fd50a149d4c2f296b"
}
logName: "projects/[my-project-name]/logs/appengine.googleapis.com%2Frequest_log"
operation: {
first: true
id: "5c4a0fd300ff0c7e86eb62e71c0001737e636f696e76657273652d6d656469612d73746167696e670001323031393031323474313130333331000100"
last: true
producer: "appengine.googleapis.com/request_id"
}
protoPayload: {
@type: "type.googleapis.com/google.appengine.logging.v1.RequestLog"
appEngineRelease: "1.9.71"
appId: "s~[my-project-name]"
endTime: "2019-01-24T19:19:48.816961Z"
finished: true
first: true
host: "cloud-firestore-admin.[my-project-name].appspot.com"
httpVersion: "HTTP/1.1"
instanceId: "00c61b117c5fba456c9edcc5f075ccacb339b96d0bc7a8e35beb60cd3fd50a149d4c2f296b"
instanceIndex: -1
ip: "0.1.0.1"
latency: "0.998139s"
line: [
0: {
logMessage: "This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application."
severity: "INFO"
time: "2019-01-24T19:19:48.816504Z"
}
1: {
logMessage: "A problem was encountered with the process that handled this request, causing it to exit. This is likely to cause a new process to be used for the next request to your application. (Error code 204)"
severity: "ERROR"
time: "2019-01-24T19:19:48.816507Z"
}
]
megaCycles: "482"
method: "GET"
pendingTime: "0.010711670s"
requestId: "5c4a0fd300ff0c7e86eb62e71c0001737e636f696e76657273652d6d656469612d73746167696e670001323031393031323474313130333331000100"
resource: "/cloud-firestore-export?outputUriPrefix=gs://[my-project-name].appspot.com/backups/"
startTime: "2019-01-24T19:19:47.818822Z"
status: 500
taskName: "6c799fe7c1a404ec22117967738fcca9"
taskQueueName: "__cron"
traceId: "65811179272fc9c721d10e6cab7cdf70"
traceSampled: true
urlMapEntry: "auto"
userAgent: "AppEngine-Google; (+http://code.google.com/appengine)"
versionId: "20190124t110331"
wasLoadingRequest: true
}
receiveTimestamp: "2019-01-24T19:19:48.824360342Z"
resource: {
labels: {
module_id: "default"
project_id: "my-project-name"
version_id: "20190124t110331"
zone: "us17"
}
type: "gae_app"
}
severity: "ERROR"
timestamp: "2019-01-24T19:19:47.818822Z"
trace: "projects/[my-project-name]/traces/65811179272fc9c721d10e6cab7cdf70"
traceSampled: true
}
2019-01-24 11:19:48.816 PST
This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.
2019-01-24 11:19:48.816 PST
A problem was encountered with the process that handled this request, causing it to exit. This is likely to cause a new process to be used for the next request to your application. (Error code 204)
Конфигурация
- Биллингвключен как для проекта GCP, так и для проекта Firebase.
- В настоящее время создается хранилище Firebase и используется для хранения файлов mp3 и txt в каталоге с именем content с новым пустым каталогом с именем backups , созданным для хранения результатов задания Cron для экспорта.
![screen shot 2019-01-24 at 10 20 20 am](https://user-images.githubusercontent.com/3938076/51699502-beb20e00-1fc1-11e9-8fdc-091e0ac9d61d.png)
Следующие разрешения включены, как рекомендовано в разделе
Настройка прав доступа .
![screen shot 2019-01-24 at 10 17 02 am](https://user-images.githubusercontent.com/3938076/51699434-962a1400-1fc1-11e9-8dbf-babadca8f3ba.png)
Проект GCP определен как по умолчанию .![screen shot 2019-01-24 at 12 05 35 pm](https://user-images.githubusercontent.com/3938076/51705479-9251be00-1fd0-11e9-8cb6-c7754e38bb2d.png)
Код app.yaml и app.js имеет кодбыл скопирован как есть.
Для package.json атрибуты name
, version
и description
былиизменено специфично для проекта.
В cron.yaml настроены атрибуты description
и url
.Для url
была предпринята следующая попытка экспортировать все коллекции:
/cloud-firestore-export?outputUriPrefix=gs://[my-project-name].appspot.com/backups
Попытки решения
- Код версии: Увеличение кода версии при последующих развертываниях.
cron.yaml
url: - Добавление
/
после каталога: /cloud-firestore-export?outputUriPrefix=gs://[my-project-name].appspot.com/backups/
- Добавление
collections
запроса, но оставление его пустым: /cloud-firestore-export?outputUriPrefix=gs://[my-project-name].appspot.com/backups&collections
- Разрешения IAM : Добавление Облачное хранилище данныхИмпортировать разрешение на экспорт администратора в мою учетную запись пользователя my-name@domain.com, поскольку это учетная запись электронной почты, связанная с проектом в
gcloud config configurations list
.