[SOLVED] wapt-scanpackages ImportError No module cryptograph

Questions about WAPT Server / Requests and help related to the WAPT server
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
bastien
Messages: 3
Registration: June 29, 2018 - 5:20 PM

June 29, 2018 - 5:47 PM

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
Last edited by bastien on July 2, 2018 - 5:01 PM, edited 1 time.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

June 30, 2018 - 12:47

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/
bastien
Messages: 3
Registration: June 29, 2018 - 5:20 PM

July 2, 2018 - 9:47 AM

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.
bastien
Messages: 3
Registration: June 29, 2018 - 5:20 PM

July 2, 2018 - 10:27

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!
Locked