[pymongo-voyageai] Intermittent certificate verify failed errors

XMLWordPrintableJSON

    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      https://spruce.mongodb.com/task/ai_ml_pipeline_testing_test_pymongo_voyageai_rhel_test_pymongo_voyageai_local_patch_5f2964dcecb4f21975d2660b9d720e9cf29bf72b_68406b88ac869900072382a4_25_06_04_16_03_13/logs?execution=3

      [2025/06/04 14:00:06.340] FAILED tests/test_client_integration.py::test_text_and_images - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] FAILED tests/test_client_integration.py::test_pdf_pages - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] FAILED tests/test_client_integration.py::test_pdf_pages_storage - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] FAILED tests/test_client_integration.py::test_pdf_pages_custom_storage - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] FAILED tests/test_client_unit.py::test_text_and_images - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] FAILED tests/test_client_unit.py::test_pdf_pages - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] FAILED tests/test_client_unit.py::test_pdf_pages_storage - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] FAILED tests/test_utils.py::test_url_to_images_pdf - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] FAILED tests/test_utils.py::test_url_to_images_png - urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1028)>
      [2025/06/04 14:00:06.340] =================== 9 failed, 5 passed, 6 warnings in 22.13s ===================
      

      We can explicitly use the certify certs to avoid any issues coming from the build host setup:

      ssl_context = ssl.create_default_context(cafile=certifi.where())
      response = urllib.request.urlopen('<url>', context=ssl_context)
      

              Assignee:
              Steve Silvester
              Reporter:
              Steve Silvester
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: