gimite / google-drive-ruby

A Ruby library to read/write files/spreadsheets in Google Drive/Docs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google Drive session not fetching files - 404 'Invalid Request'

LiveLink-JoshOne opened this issue · comments

Hi there

I have had this issue with the Google Drive api since early last week, and am unable to fix it myself.
I have tried all means of authentication myself, but with the same issue:

irb(main):001:0> require 'google_drive'
=> true
irb(main):002:0> session = GoogleDrive::Session.from_config("/path/to/oauth.json")
=> #<GoogleDrive::Session:0x3fbb5f4eaee4>
irb(main):003:0> session.files
Google::Apis::ClientError: Invalid request
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/lib/google/apis/core/http_command.rb:228:in `check_status'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/lib/google/apis/core/api_command.rb:117:in `check_status'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/lib/google/apis/core/http_command.rb:193:in `process_response'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/lib/google/apis/core/http_command.rb:310:in `execute_once'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/lib/google/apis/core/http_command.rb:113:in `block (2 levels) in execute'
        from /usr/local/lib/ruby/gems/2.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
        from /usr/local/lib/ruby/gems/2.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
        from /usr/local/lib/ruby/gems/2.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/lib/google/apis/core/http_command.rb:110:in `block in execute'
        from /usr/local/lib/ruby/gems/2.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
        from /usr/local/lib/ruby/gems/2.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
        from /usr/local/lib/ruby/gems/2.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/lib/google/apis/core/http_command.rb:102:in `execute'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/lib/google/apis/core/base_service.rb:360:in `execute_or_queue_command'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google-api-client-0.30.10/generated/google/apis/drive_v3/service.rb:1191:in `list_files'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google_drive-3.0.3/lib/google_drive/session.rb:603:in `call'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google_drive-3.0.3/lib/google_drive/session.rb:603:in `execute_paged!'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google_drive-3.0.3/lib/google_drive/session.rb:611:in `execute_paged!'
        from /usr/local/lib/ruby/gems/2.3.0/gems/google_drive-3.0.3/lib/google_drive/session.rb:256:in `files'
        from (irb):3
        from /usr/local/bin/irb:11:in `<main>'
irb(main):004:0> 

Could you shed any light on why this would be refusing to carry out quite a basic task?

Seeing the same issue here.

Fixed by upgrading to v3 of this gem (per feedback on googleapis/google-api-ruby-client#6103)