-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[apk] "BAD archive" error when installing .apk built using fpm #1227
Comments
👋 any way I can help move this? |
Woops, I lost track of this haven't looked into it yet. I'll give it a look this week. What version of Alpine is it occurring on, and Is there a set of files publicly available that can repro this behavior? |
@Knetic I was using Alpine 3.4.6
I was trying to package Yarn after applying this patch to the repo: Daniel15/yarn@932e90e. To build Yarn, clone its repo then run I think I encountered the same issue with a small directory with a single file in it though, so I don't think it's specific to the files being packaged. |
Still not resolved? |
@whitecolor apparently not. Do you have something to contribute here to helping us solve the issue? |
@josegonzalez no, sorry, just wanted to remind. |
I sat down this morning to look at it, seems like I can't repro the problem when making .apk from a directory tree, but trying to convert the yarn *.deb to *.apk definitely doesn't work. Doesn't seem to be tied to Alpine version either, 3.1 - 3.5 all seem to act the same way (which is good, means they didn't change their packaging format). Still looking. |
That's strange, I'm seeing it when trying to create a package from a
directory tree. I'll see if I can make a standalone repro.
Sent from my phone.
…On Jan 9, 2017 5:13 AM, "George Lester" ***@***.***> wrote:
I sat down this morning to look at it, seems like I can't repro the
problem when making .apk from a directory tree, but trying to convert the
yarn *.deb to *.apk definitely doesn't work. Doesn't seem to be tied to
Alpine version either, 3.1 - 3.5 all seem to act the same way (which is
good, means they didn't change their packaging format). Still looking.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1227 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFnHWOASxNMPVNsRQIJVSn1e8XCOn0uks5rQScygaJpZM4Kw253>
.
|
Testing from master a simple example works for me:
This was tested with |
Trying the original report also works correctly (it seems?) for me.
|
I can repro the second report (after doing the whole
And it seems to give me the same thing if i explode the .deb into a temp folder and try to There's quite a lot of files in the |
Here's some (hopefully complete) repro steps with the actual use case: git clone git://github.com/Daniel15/yarn.git yarn-apk-test
cd yarn-apk-test
git checkout alpinepk
./scripts/bootstrap-env-ubuntu.sh # or just look at the script and ensure all prereqs are installed
mkdir ~/.cache/yarn/
npm install
npm run build-dist
./scripts/build-deb.sh
sudo docker run -it -v $PWD:/fpm alpine /bin/sh
apk add /fpm/artifacts/yarn_0.17.0-0_noarch.apk Result:
This was with fpm 1.8.0 Here's a copy of the resulting APK file if you want to take a look: https://nightly.yarnpkg.com/temp/yarn_0.17.0-0_noarch.apk |
What version of npm and node are you using on the host, and what host are you using? |
This was on Debian Testing (Stretch) with Node.js 6.9.2 and npm v3.10.9, but I've seen the same thing on my laptop where I'm using Windows Subsystem for Linux (aka "bash on Windows") which currently uses Ubuntu 14.04. |
I've been able to reproduce the original report inside a docker-alpine container for nodejs itself (trying to apk-ize nodejs 7.4.0) using the nodejs example instructions straight out of the manual. nodejs also ships with a significant Could it be the large amount of files carried in |
@samjarrett Yeah I'm guessing it's something to do with node_modules. I tried with a single npm package in node_modules ( |
@samjarrett That was a good idea, but it seems alright to me. I generated 5k random files in a directory with this method, packaged with Feels like there's yeah, there must be some specific module with something that's choking the packaging. Haven't found anything yet by progressively deleting stuff from the yarn example though. |
Yeah it's definitely something in |
Just a guess - could it be the symlinks in |
I just tried that (a package just containing |
Yeah, even removing all symlinks with I made a couple scripts to step through and remove one module at a time from the exploded yarn deb until it successfully packaged. Alphabetically, it's cool until it reaches On the code side I can't see any obvious places where the contents of files or number or depth of them affect anything. And the package uploaded above (when decompressed) looks legit. It's bizarre, but there is some combination of modules that work, and some that don't. I'll do a longer run later and see how many of yarn's depedencies can be successfully packaged. |
not just node, but also making apk from python setup.py
Host: MacOSX In this case, the archive has maybe 6 files in it. looking at APK's source code: Unfortunately a number of cases in parsing the format can trigger the error, mostly along the lines of reading a stream and not getting the right number of bytes. I have another project that always makes APK just fine, so not sure what to make of this. |
I am experiencing the same problem with the following Kong The package has been generated from a
Actual error:
|
Running into the same issue when attempting to package the zulu jdk. The modified tar format makes this difficult to debug. |
For me, the error is raised in this loop: https://github.com/alpinelinux/apk-tools/blob/677d3240a845833dfb5c76491c0fd05efb934b2b/src/archive.c#L344. So, there seems to be unexpected data at the end of the archive. |
I'm also hitting this bug. Through Docker, I can provide a setup where the bug is always triggered. $ git clone https://github.com/nxadm/rakudo-pkg.git
$ cd rakudo-pkg
$ git checkout alpine
$ sudo bin/pkg_rakudo.pl --arch amd64 --os alpine --os-version 3.6 --moar 2017.09.1 --nqp 2017.09 --rakudo 2017.00 --pkg-rev 01 --dir /var/tmp --id nxadm If you know you way around Docker, the image is also on the Docker Hub: This command will successfully build Rakudo Perl 6 on alpine and then it will package it. It will fail when it tries to install the package as a test:
|
In my case commenting out add_paxstring fixed the package that previously failed with "BAD archive" during installation. Seems that adding PaxHeader keyword breaks records with long paths. |
I can confirm that @sarnautov's solution works. I just commented out that in fpm's source and installable packages are created without a problem. I don't know what the implication is to remove the |
Thanks for all the testing and research! We should be able to get this fix
into fpm.
…On Fri, Nov 24, 2017 at 3:10 AM nxadm ***@***.***> wrote:
I can confirm that @sarnautov <https://github.com/sarnautov>'s solution
works. I just commented out that in fpm's source and installable packages
are created without a problem. I don't know what the implication is to
remove the add_paxstring call, but my packages
<https://github.com/nxadm/rakudo-pkg/releases> work fine without it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1227 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIC6us18-lA0Sykls7nbCO3DJOvqHLdks5s5qQ-gaJpZM4Kw253>
.
|
@jordansissel any update on this issue? |
@thefosk not at this time. I haven't much personal time to work on this, and I dont' think any patch is available for testing? I can try to make time this week, but I am not sure if I will have time to do so :| Between the reproduction (#1227 (comment)) and the suggested fix (#1227 (comment)) in this issue, maybe I can make a PR with this and hope it it doesn't break anything? |
Sadly, the solution seem only to work partially:
The created package is installed despite the warning and the binaries work fine. However, I am not able to delete the package. |
I was too fast, it works with the correct apk incantation:
|
Just wanted to drop in and say that the solution listed here worked for me too. Different error but pretty sure that's related to my recipe. |
Since it seems that some progress has been made on this issue, perhaps somebody familiar with the codebase could submit a PR ? |
The proposed fix above is extremely simple to do however I'm not familiar enough with the APK package format to know if I'm just papering over the issue rather than actually resolving a bug properly. |
+1 to removing add_paxstring |
* feat(docker): use ruby:latest * feat(docs): add README * chore(docs): add note re: semantic-release * fix(fpm): add patch for apk See also: jordansissel/fpm#1227 * chore(*): appease pre-commit
This is the command I'm running to build the package - I removed a bunch of other parameters I was pasing (vendor, url, license, maintainer, etc.) and I'm still seeing the same error:
cc @Knetic
The text was updated successfully, but these errors were encountered: