googleapis / googleapis/google-cloud-ruby

Exception when pretty printing generated configuration objects

Aperta
#23,536 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
priority: p2 type: bug
Lingua principale
Ruby
Stelle
1.4k
Fork
578
Merge medio
1g 11h
PR unite (30g)
166

Descrizione

#### 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 `'
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da google/cloud/config.rb al frame method_missing del backtrace, quindi riproduci il fallimento con il comando COMPUTE_CREDENTIALS documentato e il pp di Ruby. Traccia il modo in cui il client AcceleratorTypes generato espone il proprio oggetto di configurazione; il lavoro è completato quando la stampa formattata del client non solleva più NoMethodError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ruby
Ambito
api
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.