Page 1 of 3

ERROR building package

Published: March 28, 2018 - 12:20
by Mathieu
- Installed WAPT version (1.5)
- Server OS (Linux) and version (Debian Jessie)
- Operating system of the administration/package creation machine (Windows 10)

Good morning,

When uploading a package, after signing the package, PyScripter returns an error and marks my package as failed

Code: Select all

Ligne de Commande : -i build-upload "N:\futur-Datastage-wapt\WAPT\.."
Building packages 1 packages
Personal certificate is FUTUR-TECH
Private key is <SSLPrivateKey u'.pem'>
Building  N:\futur-Datastage-wapt
...done building. Package filename N:\futur-Datastage_11-1_all.wapt
Signing N:\futur-Datastage_11-1_all.wapt with key <SSLPrivateKey u'.pem'> and certificate FUTUR-TECH (.crt)
  ERROR building N:\futur-Datastage-wapt: Bad magic number for file header
0 packages successfully built
1 packages failed 
List of errors :
N:\futur-Datastage-wapt
Buildind and uploading packages to wapt
FATAL ERROR : Exception: No package to upload
Exit code:  3
The size of the build folder is 3GB.

I tested the command `wapt-get build-package`<chemin du paquet> I keep getting the same error message

Thank you

Re: ERROR building package

Published: March 28, 2018 - 1:46 PM
by htouvet
Have you correctly entered a personal certificate in the file?

Code: Select all

%LOCALAPPDATA%\waptconsole\waptconsole.ini

Code: Select all

[global]
...
personal_certificate_path=C:\private\moncertificat.crt


Re: ERROR building package

Published: March 28, 2018 - 1:51 PM
by Mathieu
Yes, of course, I just removed the network name and path from my .crt and .pem files in the code.

All my other packages build/upload fine; it's just this one that's giving me trouble.

Re: ERROR building package

Published: March 28, 2018 - 3:01 PM
by htouvet
Apparently, this is a problem with Python's ZipFile library.
Could you try opening the file n:\futur-Datastage_11-1_all.wapt that needs to be created?
It's a ZIP file that 7-Zip, for example, should be able to open and unzip.
If 7-Zip can't, then the ZipFile library in Python has a problem.

In the signing process that follows the creation of the ZIP file, the control file is replaced within the ZIP, and the manifest and certificate are added. This phase seems to be the issue because an entry in the ZIP file during the previous phase is incorrect.

Re: ERROR building package

Published: March 28, 2018 - 3:14 PM
by Mathieu
I don't have a .wapt file once I get the error.

The file is present during the build/upload process, but once the error occurs, the file no longer exists.

Re: ERROR building package

Published: March 28, 2018 - 4:03 PM
by htouvet
To debug the problem, the instruction that cleans up if the signature fails would need to be commented out in the Wapt code.


In<wapt> \wapt-get.py:

comment on the 2 lines (887 and 888 in my version)
:

Code: Select all

                        if package_fn and os.path.isfile(package_fn):
                            os.unlink(package_fn)

Code: Select all

                    except Exception as e:
                        # remove potentially broken or unsigned resulting package file
                        #if package_fn and os.path.isfile(package_fn):
                        #    os.unlink(package_fn)
                        errors.append(source_dir)
                        print(u'  ERROR building %s: %s' % (source_dir,e))

Re: ERROR building package

Published: March 28, 2018 - 4:42 PM
by Mathieu
I just performed the procedure and I'm still getting the same error message

htouvet wrote: March 28, 2018 - 4:03 PM To debug the problem, the instruction that cleans up if the signature fails would need to be commented out in the Wapt code.


In<wapt> \wapt-get.py:

comment on the 2 lines (887 and 888 in my version)
:

Code: Select all

                        if package_fn and os.path.isfile(package_fn):
                            os.unlink(package_fn)

Code: Select all

                    except Exception as e:
                        # remove potentially broken or unsigned resulting package file
                        #if package_fn and os.path.isfile(package_fn):
                        #    os.unlink(package_fn)
                        errors.append(source_dir)
                        print(u'  ERROR building %s: %s' % (source_dir,e))

Re: ERROR building package

Published: March 28, 2018 - 11:22 PM
by htouvet
Yes, commenting on these lines wasn't going to solve the problem... ;)
But having the intermediate package (before signing) to check if 7zip can unzip it correctly would help.

Re: ERROR building package

Published: March 29, 2018 - 08:18
by Mathieu
My bad! =)

I just checked, the .wapt file is indeed present.

I extracted it with 7-Zip, and I got 1239 errors with the problem "Header error:..."

Re: ERROR building package

Published: March 30, 2018 - 12:05 PM
by Mathieu
While waiting for a solution, I switched to another package, also large (AdobeCC), and I have exactly the same problem:

ERROR building N:\futur-AdobeCC_2018-wapt: Bad magic number for file header.

Is this a problem with WAPT and large packages?