Open 1oglop1 opened 2 years ago
Thanks for opening the issue @1oglop1. I am struggling to understand why the api is throwing the above error. This is a resource the provider is erroneously trying to set the autoname for which I have disabled locally. Yet I continue to see the same error as you. The Google native provider is correctly following the API specification for this resource outside of the above issue. Even running a simple example using the Google Go SDK is running into the same issue. I don't see a lot of material on creating Cloud Run Jobs outside of the console or CLI. I believe the Terraform provider doesn't support it either. I will bring this up with our Google contact.
package main
import (
"context"
"fmt"
"google.golang.org/api/run/v2"
)
func main() {
ctx := context.Background()
err := doRun(ctx)
if err != nil {
panic(err)
}
}
func doRun(ctx context.Context) error {
runService, err := run.NewService(ctx)
if err != nil {
return err
}
jobsService := run.NewProjectsLocationsJobsService(runService)
createCall := jobsService.Create("projects/XXXX/locations/us-central1",
&run.GoogleCloudRunV2Job{
Template: &run.GoogleCloudRunV2ExecutionTemplate{
TaskCount: 1,
Template: &run.GoogleCloudRunV2TaskTemplate{
MaxRetries: 0,
Timeout: "600s",
Containers: []*run.GoogleCloudRunV2Container{
{
Image: "us-docker.pkg.dev/cloudrun/container/job:latest",
},
},
ServiceAccount: "XXXX",
},
},
})
createCall.JobId("test")
op, err := createCall.Do()
if err != nil {
return err
}
fmt.Printf("operation result: %+v\n", string(op.Response))
return nil
}
Thank you for the detailed info about the problem!
I used CLI to create the job and update the image in CI/CD as well.
For the reference this is the command gcloud beta run jobs create
, I tried debug verbosity but beta
group did not log the requests.
I also wonder if v2
API can be the source of the problem, since docs mention create
endpoint in v1
https://cloud.google.com/run/docs/reference/rest/v1/namespaces.jobs/create
Thank you for the detailed info about the problem! I used CLI to create the job and update the image in CI/CD as well. For the reference this is the command
gcloud beta run jobs create
, I tried debug verbosity butbeta
group did not log the requests.I also wonder if
v2
API can be the source of the problem, since docs mentioncreate
endpoint inv1
https://cloud.google.com/run/docs/reference/rest/v1/namespaces.jobs/create
Yes I am suspecting something subtle missing from the v2 apis. The discussion here on adding jobs support also seems to discuss the v1 api: https://github.com/hashicorp/terraform-provider-google/issues/11743
Any chance of traction here? Seems the issue is upstream with Googles docs :(
I wonder if this fix helps https://github.com/hashicorp/terraform-provider-google/releases/tag/v4.46.0
Does the issue still persist?
few observations from error logs
google-native:run/v2:Job (job):
error: error sending request: googleapi: Error 404: Requested entity was not found.:
"https://run.googleapis.com/v2/projects/my-gcp-project/locations/europe-west3/jobs?jobId=myjob"
The reason could be {jobId} is expected as path param. https://run.googleapis.com/v2/projects/my-gcp-project/locations/europe-west3/jobs/myJob might succeed.
API Reference doc : https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs/get
map[__autonamed:true jobId:myjob location:europe-west3 name:projects/my-gcp-project/locations/europe-west3/jobs/job-570f641
project:my-gcp-project template:map[taskCount:1 template:map[containers:[map[image:us-docker.pkg.dev/cloudrun/container/job:latest]] maxRetries:0 timeout:600s]]]
Also not sure if this is expected, jobId: myjob and as per this it should be converted to name:projects/my-gcp-project/locations/europe-west3/jobs/myJob
@mikhailshilkov & team More specifically can you pl mention what error/unexpected behaviour from run.googleapis.com endpoint side.
What happened?
I'm trying to deploy Cloud Run Job (currently in public preview) but I keep getting 404s.
Steps to reproduce
Create a ts project wi
Expected Behavior
everything is deployed
Actual Behavior
Only
artifactregistry
is deployed correctly.Error:
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).