SSL Error for downloading files or analysing uploaded files

Hi,

I could not download the sample data as it gives me the following error, does it have anything to do with the enterprise envirment? Thank you.

`Traceback (most recent call last):
File “viktor_connector\connector.pyx”, line 298, in connector.Job.execute
File “viktor\core.pyx”, line 2027, in viktor.core._handle_job
File “viktor\core.pyx”, line 1973, in viktor.core._handle_job._handle_button
File “viktor\result.pyx”, line 151, in viktor.result.DownloadResult._serialize
File “viktor\result.pyx”, line 152, in viktor.result.DownloadResult._serialize
File “viktor\api_v1.pyx”, line 1806, in viktor.api_v1._API._upload_temporary_file
File “viktor\api_v1.pyx”, line 1790, in viktor.api_v1._API._generate_temporary_file_urls

viktor._vendor.requests.exceptions.SSLError: HTTPSConnectionPool(host=‘cloud.viktor.ai’, port=443): Max retries exceeded with url: /api/storage/temporary_file/ (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)’)))

Param:

    Section0.download_sample_csv = DownloadButton(
        "Download sample CSV file",
        method="perform_download",
        visible=Lookup("Section0.get_sample_csv_toggle"),
        flex=30,
    )

Controller:

    @staticmethod
    def _get_sample_file():
        gef_file_path = Path(__file__).parent / 'Sample_test.csv'
        return File.from_path(gef_file_path)

    def perform_download(self, **kwargs):
        gef_file = self._get_sample_file()
        return DownloadResult(gef_file, "Sample_test.csv")

Regarding analysing the user-uploaded files, I suspect I got the follow error for the similar reason:
Traceback (most recent call last):
File “viktor_connector\connector.pyx”, line 298, in connector.Job.execute
File “viktor\core.pyx”, line 2029, in viktor.core._handle_job
File “viktor\core.pyx”, line 2012, in viktor.core._handle_job._handle_view
File “viktor\views.pyx”, line 2519, in viktor.views.View._wrapper
File “C:\Users.…app.py”, line 193, in plot_combined_subplots
cs_points, all_data = extract_uploaded_data(epa_CS, file_resource,params.Section0.skip_rows)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users.…functions.py”, line 113, in extract_uploaded_data
csv_file = FileResource.file.getvalue(“ISO-8859-1”)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “viktor\core.pyx”, line 1074, in viktor.core.File.getvalue
File “viktor\core.pyx”, line 1059, in viktor.core.File.open
File “viktor\core.pyx”, line 894, in viktor.core._URLFileManager.create_text_file
File “viktor\core.pyx”, line 732, in viktor.core._TextURLFile.init
File “viktor\core.pyx”, line 728, in viktor.core._TextURLFile.init
File “viktor\core.pyx”, line 628, in viktor.core._ResponseStream.init
File “viktor\core.pyx”, line 642, in viktor.core._ResponseStream._create_iterator
ConnectionError: Could not connect to url ‘https://cloud.viktor.ai/api/workspaces/4853/files/5343/download/’.

Hi Hao, thanks for reporting.

We are aware of this issue and are currently working on a fix! We will keep you up to date.

1 Like

@Hao We have made a release candidate which contains a fix. Could you check whether your app works when using viktor==14.15.2rc1?

could not viktor-cli start this rc version though

Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘connector’

Alright so to be clear, you did the following right?

  1. in requirements.txt specify viktor==14.15.2rc1
  2. run viktor-cli install
  3. run viktor-cli start

Could you also give me the following info please:

  • are you using venv (virtual env) or docker isolation?
  • which Python version are you using?
  • if you switch to any other version (e.g. viktor==14.15.0 / viktor==14.15.1), can you start the app again?

In case you are using a virtual env as isolation mode, another thing to try is removing that folder entirely and reinstall the app.

Hi Mate, all good now, I can confirm this has been fixed

Great, thanks for the feedback. You can keep using this release candidate for the time being, but I’d advise to upgrade to a stable version once available. I’ll update you when this has been released.

Hi @Hao we have just released SDK v14.15.2 which contains the fix.