Skip to content

Refresh View Cloud Task not created when a new dataset is downloaded #1308

Description

@davidgamez

Describe the bug

The Refresh View Cloud Task is not created when a new dataset is downloaded.

Steps/Code to Reproduce

  1. Use DEV or QA. The following steps are based on Qa

  2. 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')
  1. 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"
}'
  1. 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]:

  1. Let's make the task name simple, removing references to location and project, as the queue is already localized in a project and region.
  2. I think we are also missing the role to roles/cloudtasks.enqueuer for the batch service account. Example, here

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions