question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting "Request contains an invalid argument" on script v1 requests

See original GitHub issue

Environment details

  • OS: Windows 10 and Ubuntu 16.04
  • Python version: 2.7.12
  • pip version: 18.1
  • google-api-python-client version: 1.7.4 and 1.7.8

I’ve been using the script API for several months but within the last 2 days I am unable to even build the service as I keep getting “Request contains an invalid argument”.


store = Storage('oauth_creds.json')
credentials = store.get()
http = credentials.authorize(httplib2.Http())
service = discovery.build('script', 'v1', http=http)

Traceback is:

Traceback (most recent call last):
  File "D:\myscript.py", line 1000, in get_script_service
    service = discovery.build('script', 'v1', http=http)
  File "C:\Python27\lib\site-packages\googleapiclient\_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Python27\lib\site-packages\googleapiclient\discovery.py", line 230, in build
    raise e

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
p-doylecommented, Feb 22, 2019

I tried that but it didn’t work for me. Not sure why I had it like this originally but I ended up changing

http = credentials.authorize(httplib2.Http())
service = discovery.build('script', 'v1', http=http)

to this: service = discovery.build('script', 'v1', credentials=credentials)

and it’s working fine now.

0reactions
partheacommented, Dec 13, 2020

I’m going to close this issue since it will be resolved with #1063.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google App Script API cannot authenticate "Request contains ...
1. Use authorization script at Quickstart. 2. If you want to use the script in your question, please modify from http = credentials.authorize( ......
Read more >
Request contains an invalid argument. [246917883]
I'm trying to pull my playlists with Youtube API. The code that works in my local does not work on the server. I'm...
Read more >
HTTP status and error codes for JSON | Cloud Storage
Successful requests return HTTP status codes in the 2xx range. ... Example values include Invalid argument , Login required , and Required parameter: ......
Read more >
Resolve errors | Google Drive
Resolve a 400 error: Invalid sharing request ... This error can occur for several reasons. To determine the limit that has been exceeded,...
Read more >
Error Messages | API Connector for Google Sheets
This error occurs when your request body is incorrectly formatted. Ensure your request body is valid JSON. September 2022 update: Some users may ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found