cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with HANA XSA (SP4) Python runtime

sunkee
Explorer

Hi,

I am having an issue when I try to push an python 3.x app using the SP4 buildpack and the script mentioned in the blog from denys.kempen (https://blogs.sap.com/2019/02/11/setup-python-runtime-for-xsa-by-the-sap-hana-academy/) to create the runtime directly on the XSA host (in my case I am using the HXE host).

When pushing the app, the system tries to compile with the HXE OS installed 2.x python version in the staging process. Due to this it gives an error that ssl is not available. When I install python 3 on the hxe host and update alternatives to switch from python 2 to python 3 for the python command on the OS, the app deployes and runs just fine. (I am aware that this is a pretty dirty hack / workaround).

Please see the following log output:

#2.0#2020 09 24 18:44:15.735#Z#DEBUG#com.sap.cloud.lm.sl.xs2.17501.MAIN_LOG.stageAppTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-1###
[StageAppStep] Detect: BUILD_DIR     [/hana/shared/HXE/xs/app_working/stager/work/fd62916b-b40c-4a17-ab2d-a0be5090ce0b-9/droplet/app]
Detect: BUILDPACK_DIR [/hana/shared/HXE/xs/app_working/stager/cache/2cbeac53-ed1c-4d64-8eac-d3b8354f1645/bin/..]
Python Buildpack version: 0.3.3
Logging was set to INFO
Compile: started, running with python version: 2.7.13
Compile: BUILD_DIR      [/hana/shared/HXE/xs/app_working/stager/work/fd62916b-b40c-4a17-ab2d-a0be5090ce0b-9/droplet/app]
Compile: CACHE_DIR      [/hana/shared/HXE/xs/app_working/stager/cache/2953698a-f374-4582-ab77-986536a85773-2cbeac53-ed1c-4d64-8eac-d3b8354f1645]
Compile: BUILDPACK_DIR  [/hana/shared/HXE/xs/app_working/stager/cache/2cbeac53-ed1c-4d64-8eac-d3b8354f1645]
Compile: application requires python version 3.4.6
Fetch runtime: download url - https://hxehost:39030/v2/runtimes/cd8e4ed3-9390-45d2-b386-f3adf48b271a/python-version?versionRange=3...
Traceback (most recent call last):
  File "/hana/shared/HXE/xs/app_working/stager/cache/2cbeac53-ed1c-4d64-8eac-d3b8354f1645/bin/../buildpack/compile_app.py", line 89, in <module>
    start(sys.argv[1], sys.argv[2], os.path.abspath(sys.argv[3]))
  File "/hana/shared/HXE/xs/app_working/stager/cache/2cbeac53-ed1c-4d64-8eac-d3b8354f1645/bin/../buildpack/compile_app.py", line 40, in start
    python_home = python.create_runtime(build_dir, required_version, compound_cafile)
  File "/hana/shared/HXE/xs/app_working/stager/cache/2cbeac53-ed1c-4d64-8eac-d3b8354f1645/buildpack/utils/python.py", line 39, in create_runtime
    runtime.download(python_zip_path, required_version, cafile)
  File "/hana/shared/HXE/xs/app_working/stager/cache/2cbeac53-ed1c-4d64-8eac-d3b8354f1645/buildpack/utils/runtime.py", line 36, in download
    response = urlopen(url, cafile=cafile)
  File "/usr/lib64/python2.7/urllib2.py", line 141, in urlopen
    raise ValueError('SSL support not available')
ValueError: SSL support not available
Execution of bin/compile failed (exit value 1)
Failed to stage app 'cnj-python' [Org 'HANAExpress', Space 'development']: Execution of bin/compile failed (exit value 1).#

However, my understanding is that the runtime within the XSA should not be affected by OS configurations or installations. Am I missing something while creating the runtime?

Thanks,

Eik

sunkee
Explorer

Hi,

after doing some more testing, I ended up installing the python-pyOpenSSL (Python wrapper module around the OpenSSL library) module on my OS and then the application staged and started.

Accepted Solutions (0)

Answers (1)

Answers (1)

CharlesFeng
Advisor
Advisor
0 Kudos

Hi eik-sunke,

Thanks for sharing your test result.

Please let us know if there is anything else we can help.

Best regards,
Charles