Hello all, thanks in advance for any help you can ...
# announcements
c
Hello all, thanks in advance for any help you can give. I am trying to get tap-bing-ads running through meltano and I am getting the following error: urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)> Anyone have any experience troubleshooting this? Thanks!
d
@chris_marchetti What OS and Python installation method are you using? Some potential solutions for macOS are discussed here: https://stackoverflow.com/questions/50236117/scraping-ssl-certificate-verify-failed-error-for-http-en-wikipedia-org
c
MacOS Catalina and I think I used homebrew. I am using python 3.7.3.
d
@chris_marchetti This may help: https://stackoverflow.com/a/44649450
c
Thanks! I will check it out.
Still having issues. I ran the script that they recommended and got another error: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.7' Consider using the
--user
option or check the permissions.
d
@chris_marchetti Could you run the script with
sudo
?
c
Worked better, but got this error now: FileNotFoundError: [Errno 2] No such file or directory: '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/etc/ssl'
d
Hmm 😕 I'm not sure I can help much more beyond this point, because it appears to be an issue specific to your Python installation rather than
tap-bing-ads
or Meltano specifically. Personally, I haven't had any issues with Python 3 installed using pyenv, and pyenv installed using Homebrew. For me,
Copy code
python -c 'import ssl; print(ssl.get_default_verify_paths().openssl_cafile)'
outputs
/usr/local/etc/openssl@1.1/cert.pem
. You may have more luck with that setup as well, but I'm not quite sure why your Homebrew installation isn't behaving like it is for those StackOverflow users
c
I used the command you just specified and I got: /Users/cmarchetti/opt/anaconda3/ssl/cert.pem
d
Interesting; I got that command from https://stackoverflow.com/a/61294657
c
Ok, I will look there. Is anaconda the problem?
d
Since the user in the example got
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/etc/ssl/cert.pem
as the output, I assumed that's where your
FileNotFoundError: [Errno 2] No such file or directory: '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/etc/ssl'
was coming from as well
If you're seeing that error, but your
openssl_cafile
is not actually at that conclusion, that explains the error
I don't think Anaconda is necessarily the problem, but you'll want to make sure you run the script from StackOverflow in the conda context, so that
Copy code
ssl.get_default_verify_paths().openssl_cafile
will evaluate to
/Users/cmarchetti/opt/anaconda3/ssl/cert.pem
rather than the long Xcode path
c
I was able to get the script to run in conda, but when I try to run:
meltano invoke tap-bing-ads --discover
in the virtual environment that I created for the meltano project, it still throws the error.
d
@chris_marchetti Are you seeing the same error if you install tap-bing-ads directly into its own venv, and run it without Meltano?
c
No, I was first working in just singer and was able to run the tap in a venv there without any issues.
d
Hmm, that is interesting. Perhaps the issue is with Conda, then. Meltano will have created a venv for
tap-bing-ads
using
<sys.excutable> -m venv .meltano/extractors/tap-bing-ads/venv
.
sys.executable
is the same
python
Meltano itself will have been run with. I wonder if that nested venv is somehow broken because the top-level venv is a Conda venv rather than a plain python venv? If you directly execute ``.meltano/extractors/tap-bing-ads/venv/bin/tap-bing-ads``, do you also see an error? And what does
.meltano/extractors/tap-bing-ads/venv/pyvenv.cfg
look like?
c
When I execute the first command I get: usage: tap-bing-ads [-h] -c CONFIG [-s STATE] [-p PROPERTIES] [--catalog CATALOG] [-d] tap-bing-ads: error: the following arguments are required: -c/--config
pyvenv.cfg looks like: tap-bing-ads/venv/pyvenv.cfg home = /Users/cmarchetti/Documents/Datateer/VividFront/base-meltano/.venv/bin include-system-site-packages = false version = 3.7.3
d
Ah yeah, you'll still want to provide the appropriate command flags, like when you were running the tap without Meltano entirely 🙂 If you pass it a path to a config file, do you see the same SSL error?
pyvenv.cfg
looks right to me.
c
Is the config file meltano.yml? Or do I go back to the singer config file and catalog?
Thanks for your help today! I really appreciate it. I have decided to use docker to clean up the python environment for the moment.
d
The executable at
.meltano/extractors/tap-bing-ads/venv/bin/tap-bing-ads
is the basic Singer tap executable, so you'd need to use the Singer config file and catalog to see if it gives you the same error when run without Meltano, as when run with it.
Using Docker is definitely another possible solution 🙂