googleapis / googleapis/google-cloud-ruby
Exception when pretty printing generated configuration objects
- Dominant language
- Ruby
- Stars
- 1.4k
- Forks
- 578
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 166
Description
#### Environment details
- OS: macOS 13.6.1
- Ruby version: 3.2.2
- Gem name and version:
```shell
$ gem list google-cloud-
*** LOCAL GEMS ***
google-cloud-common (1.3.0)
google-cloud-compute (1.2.0)
google-cloud-compute-v1 (2.5.0)
google-cloud-core (1.6.0)
google-cloud-env (1.6.0)
google-cloud-error_reporting (0.42.3, 0.42.2)
google-cloud-error_reporting-v1beta1 (0.8.0, 0.6.0)
google-cloud-errors (1.3.1)
google-cloud-logging (2.3.3, 2.3.2)
google-cloud-logging-v2 (0.11.0, 0.8.1)
google-cloud-pubsub (2.15.1)
google-cloud-pubsub-v1 (0.15.1)
google-cloud-storage (1.44.0)
google-cloud-trace (0.42.2, 0.42.1)
google-cloud-trace-v1 (0.7.0, 0.5.0)
google-cloud-trace-v2 (0.7.0, 0.5.0)
```
#### Steps to reproduce
require `tempfile` and try to pretty print (`pp`) the client object
#### Code example
`credentials.json` is the standard key file:
```json
{
"type": "service_account",
"project_id": "patrik-testing",
"private_key_id": "REDACTED",
"private_key": "REDACTED",
"client_email": "REDACTED",
"client_id": "REDACTED",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/REDACTED",
"universe_domain": "googleapis.com"
}
```
Run this
COMPUTE_CREDENTIALS=credentials.json ruby -rtempfile -rgoogle/cloud/compute -e 'pp Google::Cloud::Compute.accelerator_types'
#### Full backtrace
```sh
$ COMPUTE_CREDENTIALS=credentials.json ruby -rtempfile -rgoogle/cloud/compute -e 'pp Google::Cloud::Compute.accelerator_types'
#,
@default_parallel_manager=nil,
@headers={"Content-Type"=>"application/json", "User-Agent"=>"Faraday v2.7.11"},
@manual_proxy=false,
@options=
#,
@parallel_manager=nil,
@params={},
@proxy=nil,
@ssl=
#,
@url_prefix=#>,
@credentials=
#,
@state=nil,
@target_audience=nil,
@token_credential_uri=#,
@username=nil>,
@env_vars=nil,
@paths=nil,
@project_id="patrik-testing",
@quota_project_id=nil,
@scope=nil>,
@endpoint="https://compute.googleapis.com",
@numeric_enums=false,
@raise_faraday_errors=false>>,
@config=
#:Google::Cloud::Config (NoMethodError)
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:188:in `pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:274:in `block (3 levels) in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:272:in `block (2 levels) in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:260:in `block in seplist'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:254:in `each'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:254:in `seplist'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:267:in `block in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:215:in `object_address_group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:266:in `pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:328:in `pretty_print'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:197:in `block in pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:197:in `pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:274:in `block (3 levels) in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:272:in `block (2 levels) in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:260:in `block in seplist'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:254:in `each'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:254:in `seplist'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:267:in `block in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:215:in `object_address_group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:266:in `pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:328:in `pretty_print'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:197:in `block in pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:197:in `pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:274:in `block (3 levels) in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:272:in `block (2 levels) in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:260:in `block in seplist'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:254:in `each'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:254:in `seplist'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:267:in `block in pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:215:in `object_address_group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:266:in `pp_object'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:328:in `pretty_print'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:197:in `block in pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:253:in `block (2 levels) in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:280:in `nest'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:252:in `block in group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:265:in `group_sub'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/prettyprint.rb:251:in `group'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:197:in `pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:93:in `block in pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:154:in `guard_inspect_key'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:93:in `pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:646:in `block in pp'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:645:in `each'
from /Users/dentarg/.rubies/3.2.2/lib/ruby/3.2.0/pp.rb:645:in `pp'
from -e:1:in `'
```
Contributor guide
Assessment
This issue has not been assessed yet.