Page 1 of 1

[SOLVED] wapt-scanpackages ImportError No module cryptograph

Published: June 29, 2018 - 5:47 PM
by Bastien
Good morning,

My environment
WAPT Console Windows 10
WAPT server, CentOS 7, Python 2.7.5

I'm having trouble with a large package (LabView 50 GB)
I cannot upload it with the build-upload option, so I built the package and signed it.
I transfer it from my WAPT console to the WAPT server (in /var/www/html/wapt/) via scp, I have given it the correct rights and the correct owners and I finish the operation with a scan-package so that I can view it in my private repository.

Code: Select all

/usr/bin/python /opt/wapt/wapt-scanpackages.py /var/www/html/wapt/
(The documentation indicates the command without /html but neither of these commands works)

I received the response:

Code: Select all

Traceback (most recent call last):
  File "/opt/wapt/wapt-scanpackages.py", line 33, in <module>
    from waptpackage import update_packages
  File "/opt/wapt/waptpackage.py", line 89, in <module>
    from waptcrypto import EWaptMissingCertificate,EWaptBadCertificate
  File "/opt/wapt/waptcrypto.py", line 37, in <module>
    from cryptography import x509
ImportError: No module named cryptography
This is the first time I've attempted a package import this way.
I don't know if the problem is with the server or if I missed a step (or if a step went wrong) during the creation of the package.
This one, Labview, installs correctly locally on my console.

Thank you for your help

Re: wapt-scanpackages.py ImportError: No module named cryptogra

Published: June 30, 2018 - 12:47
by sfonteneau
I assume you are using version 1.5 of Wapt.

Try this instead:

Code: Select all

/opt/wapt/wapt-scanpackages.sh /var/www/html/wapt/

Re: wapt-scanpackages.py ImportError: No module named cryptogra

Published: July 2, 2018 - 9:47 AM
by Bastien
Hello and thank you for your help.

The WAPT server version is 1.5.1.23.

However, I don't have a "wapt-scanpackages.sh" script (neither in /opt/wapt/ nor anywhere else).

There might be a problem with the server if I need this script.
Is there a specific library I could install?

The server only has a self-signed certificate.

Thank you.

Re: wapt-scanpackages.py ImportError: No module named cryptogra

Published: July 2, 2018 - 10:27 AM
by Bastien
Okay, I finally got my scan-packages working!

I imported a few extra libraries:
- cryptography
- pyopenssl.

I was still getting errors on some elements of the crypto library, so I ended up commenting out the problematic lines in waptcrypto.py
: the imports:
cryptography.x509.verification (lines 43, 44)
, certifi (line 50),

and the methods related to these objects:
lines 1906, 1907, 1908,
and lines 2188, 2189, 2190.

The function /usr/bin/python /opt/wapt/wapt-scanpackages.py /var/www/html/wapt/ then ran successfully.
Perhaps I was able to do it because I only have a self-signed certificate and the modified methods aren't being called?

I'll obviously put the correct waptcrypto.py file back after the scan.

Thanks!