ERROR building package

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
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
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

March 28, 2018 - 12:20

- 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
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

March 28, 2018 - 1:46 PM

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

Tranquil IT
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

March 28, 2018 - 1:51 PM

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.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

March 28, 2018 - 3:01 PM

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.
Tranquil IT
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

March 28, 2018 - 3:14 PM

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.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

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))
Tranquil IT
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

March 28, 2018 - 4:42 PM

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))
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

March 28, 2018 - 11:22 PM

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.
Tranquil IT
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

March 29, 2018 - 08:18

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:..."
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

March 30, 2018 - 12:05

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?
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
Locked