Install the app
How to install the app on iOS

Follow along with the video below to see how to install our site as a web app on your home screen.

Note: This feature may not be available in some browsers.

Need Help with Synology Package Development: Invalid File Format Issue

As an Amazon Associate, we may earn commissions from qualifying purchases. Learn more...

2
0
NAS
DS923+
Operating system
  1. Windows
Mobile operating system
  1. Android
Hello Everyone,

I'm currently working on a Synology package build environment on my laptop running Ubuntu 24.04 LTS. I've followed the instructions from Synology's developer guide, but I'm encountering a persistent issue that I hope someone here can help me resolve.

XPeynology Specs:

  • DSM Version: DSM 7.2.1-69057 Update 5
  • Loader Version and Model: ARC 24.8.03 / DS923+
  • Installation Type: Intel(R) Xeon(R) CPU E5-1603 0 @ 2.80GHz | HP Workstation Z620
I have set up the build environment on Ubuntu 24.04 LTS and you can find the directory structure of my build environment in these two text files:

Learning Path

I started learning the basics from Synology's developer guide: Synology Developer Guide. I have carefully read through and followed the steps for:

  1. System Requirements
  2. Prepare Environment
  3. Your First Package
  4. Build Stage
  5. Pack Stage
Problem Description

I downloaded the ExamplePackages from GitHub and followed all the instructions for the Build Stage and Pack Stage. I successfully created the ExamplePackage-x86_64-1.0.0-0001.spk file. However, when I reached the "Your First Package" step, which involves manually installing the package on a Synology NAS, I encountered a significant issue.

Each time I attempted to install the package, I received the following error: "Invalid file format. Please contact the package developer."

I've meticulously checked everything, re-packaged the files multiple times, and explored various methods to resolve the issue, but the error persists. Despite my efforts, I can't seem to identify the root cause of this problem. I've scoured the internet for solutions but haven't found anything helpful. I have thoroughly verified my build environment and ensured that all files necessary for building and packaging the program are correctly set up.

This situation is frustrating, especially because I need to successfully pass this example package step to start developing my own app. Despite carefully following all the instructions and understanding the compilation process, I can't move forward due to this error.

Diagnostics and Comparisons

To further investigate the issue, I decided to download a package directly from the Synology Download Center, specifically the Text Editor package. Upon downloading, I noticed that the icon of the downloaded package appeared different, almost as if it were encrypted.

To delve deeper, I ran the file <Name_Of_Package> command in my terminal to determine the type of each package. Here are the results:

  • TextEditor Package (from Synology Download Center):
TextEditor-x86_64-1.2.5-0254.spk: Synology archive, package "TextEditor" "x86_64" "1.2.5-0254", created on "20231228-19:51:50"

  • ExamplePackage (the one I created):
ExamplePackage-x86_64-1.0.0-0001.spk: POSIX tar archive (GNU)

I also uploaded some photos to Google Drive that show the differences in the package formats and the icons. You can view them here: Screenshots.

It became clear that the two packages were in different formats. I then searched extensively on how to create a .spk file with the "Synology archive, package" format but unfortunately, I couldn't find any relevant information.

Resources and Files

To aid in troubleshooting, I have uploaded the following resources to Google Drive:

  • ExamplePackage-x86_64-1.0.0-0001.spk
  • TextEditor-x86_64-1.2.5-0254.spk
  • ExamplePackage-x86_64-1.0.0-0001 (extracted folder contents)
You can view these files and further details here: Packages.

Request for Help

I'm reaching out to the community for assistance. If anyone has experience with Synology package development and can provide insights on why my package is not being recognized correctly, I would greatly appreciate your help.

If you're willing to take a closer look, I am open to sharing more details, and I can also coordinate a session via Anydesk. Any advice or suggestions to help me get past this hurdle would be immensely valuable.

Thank you in advance for your support!
 
Probably you forgot to encrypt/sign the resulting .spk file as it sees it as .tgz
Basically, the last step is missing. Check this section, perhaps it will help: Pack Stage · GitBook
Thank you so much for your reply and the suggestion!

I carefully followed the instructions on the Synology developer guide, especially the part under the "Pack Stage." The guide mentions that PkgCreate.py should automatically sign the newly created .spk file with a GPG key if it's placed under /root/, but it also notes that the package signing mechanism is deprecated after DSM 7.0.After building my package using the command:
cd /toolkit
pkgscripts-ng/PkgCreate.py -i ${project}
I successfully created the .spk file, but it seems that the signing/encryption step didn’t occur, as the resulting .spk file is still recognized as a POSIX tar archive (GNU) rather than a Synology archive, package.

Could you possibly provide further insight into what might be missing or any steps I should take to manually sign/encrypt the package, especially in light of the deprecation after DSM 7.0? I’m eager to resolve this and appreciate any additional guidance you can offer.

Thanks again for your help!
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Popular tags from this forum

dsm

Similar threads

Yes, as indicated in point (1). Even if the boot information is lost, I don't mind, just that it will at...
Replies
4
Views
447
  • Question Question
Yes, sorry, my initial post was maybe not detailed enough. I really want a CLI tool, because then I can...
Replies
4
Views
505
good explanation... had enough trouble to get encryption on an "unsupported" system enabled. Interesting...
Replies
7
Views
770
I know theres like a million posts on synology webhooks, but none are specific, or don't apply to my exact...
Replies
0
Views
751
That's a lot of revads! It's almost as if you don't trust me :)
Replies
3
Views
3,185

Thread Tags

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending content in this forum

Back
Top