Describe the bug
The Refresh View Cloud Task is not created when a new dataset is downloaded.
Steps/Code to Reproduce
-
Use DEV or QA. The following steps are based on Qa
-
Make sure at least one dataset has a different file hash running
update gtfsdataset
set hash = '1'
where gtfsdataset.id in (select dataset.id from feed
inner join gtfsdataset as dataset on gtfsdataset.feed_id = feed.id
where gtfsdataset.latest = true
and feed.stable_id = 'mdb-511')
- Execute the batch function:
curl -X POST "https://batch-datasets-qa-563580583640.northamerica-northeast1.run.app" \
-H "Authorization: bearer $(gcloud auth print-identity-token)" \
-H "Content-Type: application/json" \
-d '{
"name": "Developer"
}'
- Filter logs by stable ID(mdb-511), get the trace_id and remove the stable_id filter. Example, link
Expected Results
Logs reflect the creation of the task, and the task can be found in the queue.
Actual Results
Logs only show Creating materialized view refresh task, then the function outputs the subsequent logs not related to the task creation. A log is also found:
Error creating task: 400 Task name must be formatted: "projects/<PROJECT_ID>/locations/<LOCATION_ID>/queues/<QUEUE_ID>/tasks/<TASK_ID>". [links {
description: "Definition of task name"
url: "https://cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#Task.FIELDS.name"
Screenshots
No response
Files used
No response
Additional notes
[Suggestions]:
- Let's make the task name simple, removing references to location and project, as the queue is already localized in a project and region.
- I think we are also missing the role to
roles/cloudtasks.enqueuer for the batch service account. Example, here
Describe the bug
The Refresh View Cloud Task is not created when a new dataset is downloaded.
Steps/Code to Reproduce
Use DEV or QA. The following steps are based on Qa
Make sure at least one dataset has a different file hash running
Expected Results
Logs reflect the creation of the task, and the task can be found in the queue.
Actual Results
Logs only show
Creating materialized view refresh task, then the function outputs the subsequent logs not related to the task creation. A log is also found:Screenshots
No response
Files used
No response
Additional notes
[Suggestions]:
roles/cloudtasks.enqueuerfor the batch service account. Example, here