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

SSL Cert Verification Error #150

Closed
amaes3owp opened this issue Nov 1, 2021 · 8 comments
Closed

SSL Cert Verification Error #150

amaes3owp opened this issue Nov 1, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@amaes3owp
Copy link

Good morning Jason -
I moved my evaluations from one machine to another during the weekend and was able to run some evaluations. When using the nwis client I got the following error.

ERROR: Unable to retrieve observations... EXITING: Cannot connect to host waterservices.usgs.gov:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')]

I can not send you the exact code but it was a simple call like the following:

from hydrotools.nwis_client import IVDataService
service = IVDataService()
df = service.get(sites='01646500', startDT="2021-01-01", endDT="2021-02-01")

Any suggestions?

Thanks!
Alex

@jarq6c jarq6c self-assigned this Nov 3, 2021
@jarq6c jarq6c added the bug Something isn't working label Nov 3, 2021
@aaraney
Copy link
Member

aaraney commented Nov 3, 2021

Not sure that this is related to #153, but it might be worth updating _restclient @amaes3owp.

Do the following to update:

pip install -U hydrotools._restclient

@amaes3owp
Copy link
Author

Thank you guys for checking on this. Let me try it. I will also try to have a new clean python installation.

@jarq6c
Copy link
Collaborator

jarq6c commented Nov 3, 2021

I was unable to duplicate this issue using the latest version of hydrotools.nwis_client and hydrotools._restclient deployed to a clean Python virtual environment on the same machine.

@aaraney
Copy link
Member

aaraney commented Nov 4, 2021

That's good to hear @jarq6c. @amaes3owp, are you still facing an issue? Or can this be closed?

@amaes3owp
Copy link
Author

I need a little more time to test.

@amaes3owp
Copy link
Author

Here is my code:

import os
import pandas as pd

Import Hydrotools module

from hydrotools.nwis_client.iv import IVDataService

def read_nwis_client():

print("Reading ")
service = IVDataService()
df = service.get(sites='01646500', startDT='2021-01-01', endDT='2021-02-01')
print(df.head())
return df

--------------- MAIN --------------------

if name == 'main':

precip = read_nwis_client()

print('Program completed successfully')

I am still getting the error. I am reinstalling miniconda again and see if the problem goes away.

@jarq6c
Copy link
Collaborator

jarq6c commented Nov 4, 2021

This snippet worked for me.

import os
import pandas as pd
from hydrotools.nwis_client.iv import IVDataService

def read_nwis_client():
    print("Reading ")
    service = IVDataService()
    df = service.get(sites='01646500', startDT='2021-01-01', endDT='2021-02-01')
    print(df.head())
    return df

if __name__ == "__main__":
    precip = read_nwis_client()
    print('Program completed successfully')

@amaes3owp
Copy link
Author

Good -
Austin we did a test, then it seems that the issue is related to the miniconda installation.
I am going to reinstall miniconda.

We can close this ticket.

Thanks!
Alex

@jarq6c jarq6c closed this as completed Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants