-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpc error: code = InvalidArgument desc = Resource name should start with "/projects/<PROJECT_ID>/" #1349
Comments
Update: Based on a similar error conversation hashicorp/terraform-provider-google#3086 , I think that I was using the wrong format for the Would be good to:
|
Thanks. You're right, we could do better here. Labeling feature request to make errors better. We unfortunately can't change the interface (constructors, input params) as that'd be a breaking change, but I suspect we could do better with errors and docs. |
Thank you for the report @mcandre and @jadekler!
@jadekler @broady should we perhaps add client-side validation for the various methods? google-cloud-go/scheduler/apiv1beta1/cloud_scheduler_client.go Lines 191 to 204 in 4b031de
We've got all of the expectations defined for the various public API definitions and can look them up in the googleapis/googleapis/*.yaml files such as:
and etc in the respective yml files. |
Aha I hadn't noticed that that code is generated
|
Alright, I've filed a bug on the issue Cloud Scheduler issue tracker https://issuetracker.google.com/issues/129926970 |
Hello again @mcandre! As per the reported issue https://issuetracker.google.com/issues/129926970 I got back information that the engineering team has fixed the error message and now it should return |
rpc error: code = InvalidArgument desc = [Argument] userId format incorrect |
Client
Scheduler
Describe Your Environment
macOS Mojave
Expected Behavior
Can create jobs using the Go Google Cloud Scheduler API, using
projects/my-cool-project/locations/us-east-1
parent prefix, as described in the official Go Google Cloud Scheduler API documentation.https://godoc.org/google.golang.org/genproto/googleapis/cloud/scheduler/v1beta1#CreateJobRequest
https://godoc.org/google.golang.org/genproto/googleapis/cloud/scheduler/v1beta1#Job
Actual Behavior
All relevant godocs for this claim that the right syntax is
project/<project>/locations/<location>
for the parent string. However, when I actually try to use this syntax, I get an error from the Go Google Cloud Scheduler API:rpc error: code = InvalidArgument desc = Resource name should start with "/projects/<PROJECT_ID>/"
Let's set aside the fact that specifying a parent project string is redundant for create job request objects, when the underlying job structure already includes this information in the job name. This generic error message does not indicate which part of the create job request is misconfigured. I just don't know.
I am trying to dig through the godocs to identify the right request format. Also leaning on the compiler to alert me to any missing fields. Note that the
Parent
field was not required by the compiler, as the public constructors for the create request object are just the struct literal, which of course allows such logically required fields to be omitted accidentally in practice.Is it the
Parent
field of theschedulerpb.CreateJobRequest
? Is it theName
field of theschedulerpb.Job
? I tried adding a forward slash prefix (/
) to one, the other, and both request objects.None of these configurations succeeds. Furthermore, some of the configurations actually produced an error message claiming that
/project/my-cool-project/locations/us-east1
should begin with/project/my-cool-project/locations/us-east1
.That error message was particularly confusing, as a string generally begins with its own contents. I haven't dove deep into the implementation, but I am curious if the validation code is suspect, or if the documentation is simply out of date. Or shudder, if the Go API may be out of date with the scheduler RPC running on the servers.
What is the exact syntax for submitting a valid create job request through the Go API? Could you please give a complete example to disambiguate?
The text was updated successfully, but these errors were encountered: