Skip to content
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

ServerNotFoundError: Unable to find the server at www.googleapis.com #388

Closed
mikelambert opened this issue Apr 25, 2017 · 9 comments
Closed
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@mikelambert
Copy link

When inserting objects to Google Cloud Storage running from Flexible VMs on GCE, I often get this error:

ServerNotFoundError: Unable to find the server at www.googleapis.com
at _conn_request (/env/local/lib/python2.7/site-packages/httplib2/__init__.py:1278)
at _request (/env/local/lib/python2.7/site-packages/httplib2/__init__.py:1351)
at request (/env/local/lib/python2.7/site-packages/httplib2/__init__.py:1609)
at new_request (/env/local/lib/python2.7/site-packages/oauth2client/client.py:631)
at _retry_request (/env/local/lib/python2.7/site-packages/googleapiclient/http.py:154)
at execute (/env/local/lib/python2.7/site-packages/googleapiclient/http.py:827)
at positional_wrapper (/env/local/lib/python2.7/site-packages/oauth2client/util.py:135)
at put_object (/home/vmagent/app/util/gcs.py:48)

The code in question:

    req = service.objects().insert(
        bucket=bucket, body=body,
        # You can also just set media_body=filename, but for the sake of
        # demonstration, pass in the more generic file handle, which could
        # very well be a StringIO or similar.
        media_body=http.MediaIoBaseUpload(f, 'application/octet-stream'))
      resp = req.execute() # the line that throws the above exception

Any idea why a GCE Flexible VM would be unable to find the server www.googleapis.com?

@mikelambert
Copy link
Author

And perhaps the question more related to this client library...is this something that might be fixed by switching to google.cloud.storage libraries versus these googleapiclient libraries?

@theacodes
Copy link
Contributor

theacodes commented Apr 25, 2017 via email

@mikelambert
Copy link
Author

Yes, I am using a derivation of the python-compat runtime. I've migrated over to env: flex at least, but am now slowly working through my dependencies to get off python-compat entirely.

@theacodes
Copy link
Contributor

Yes, I am using a derivation of the python-compat runtime.

That could be part of the problem. I'd see if you can do an isolated case without compat.

is this something that might be fixed by switching to google.cloud.storage libraries versus these googleapiclient libraries?

Nah, they both hit the same endpoint.

@mikelambert
Copy link
Author

mikelambert commented Apr 25, 2017

That could be part of the problem. I'd see if you can do an isolated case without compat.

Hahah dammit, I'm always scared the bitrot will bite me before I'm able to migrate off. The errors have recently increased in frequency in the past few days, and so I assumed it might be something on the other end. Good to know rewriting to google.cloud.storage won't fix it, saved me time there, thanks!

Further investigation, the errors appear to be occurring on a single instance (not all instances), and start happening at some point, and continue until the service is repushed (or presumably, the instance restarts, but didn't test that yet.)

My best guess is there's some DNS/connectivity process running on the machine, that breaks down and causes problems. Can't find anything in my StackDriver logs that shows anything failing/breaking, though.

@karanpanchal-crest
Copy link

karanpanchal-crest commented Mar 6, 2018

@mikelambert
Is the problem of "Unable to find the server" issue is resolved in your environment?
If yes, can you please share the solution to the issue.
I am not able to figure out the reason behind the issue, Well, the issue is not with respect to the www.googleapis.com . The issue in my environment is as follows:
"Server is not responding to the client once or twice a week. On changing the Start time in my environment, the issue gets resolved."
NOTE: "Start time" is a parameter used to collect data from the server starting from the given value.

@mikelambert
Copy link
Author

I am not sure exactly what I did to fix it. I do know that I currently create a new service each time I get/put an object. (In my case, I don't get/put them that often, so it is fine.) I suspect creating a new service anew with each request would probably help, but I understand that may not be a great solution for all use cases.

However, are you using the python-compat runtime too? ie app.yaml has enable_app_engine_apis: true?

@karanpanchal-crest
Copy link

Nope. Though I have built my product on the python language, I am not using python-compat runtime. But the issue occurs when my code tries to execute a connection request.

@JustinBeckwith JustinBeckwith added 🚨 This issue needs some love. triage me I really want to be triaged. labels Jun 8, 2018
@JustinBeckwith JustinBeckwith added type: question Request for information or clarification. Not an issue. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Jun 20, 2018
@mcdonc
Copy link
Contributor

mcdonc commented Jul 25, 2018

I don't think there's anything we can do on the client library side to help fix this. It appears to be an intermittent connectivity issue between the host that is running the client library and the googleapis.com cluster. I'm closing this as a result. Even though this is nominally a "google problem" (as the code is running on GCE), there's not much from the perspective of the maintainers of this library we can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

5 participants