dgiagio / warp

Create self-contained single binary applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Error: No tarball found inside binary" (Mac & Linux only)

rooju opened this issue · comments

I have a set of binaries (application + dependency libraries) that I'm using warp to pack as part of my automated workflow. However, lately, the packed binary has been failing to run with a "No tarball found inside binary" error message.

This only happens on Mac and Linux (Ubuntu). The packed binary runs as expected on Windows.

Also, and this is weird, this was working until today.

I even tried running the warp packer manually, outside my workflow, to the same result: works on Windows, does not work on other platforms.

I should also mention that on all 3 platforms, the packed binary does have the gzip magic header that the runner is looking for.

Any idea what might be going on? Since nothing has changed on the warp side, could something in my payload be tripping it? (Though, I can't think of anything I changed that could have caused it to drop dead so suddenly)

It looks like the tar unpack is failing.

Just for fun, I wrote a .NET program that takes the packed EXE, seeks until it finds a valid gzip header and prints out the contents of the tarball. This works just fine, so the embedded tarball isn't corrupted. Yet, the runner can't unpack it.

@rooju I'm getting this error in windows.

Steps:

  • create a Java application and generate the JAR file
  • create a sub folder called bundle and put on it:
    • jre/ --- put here all JRE 1.8.x files
    • app.jar
    • start.cmd

start.cmd:

@echo off
SETLOCAL
set "jre=%~dp0jre\bin\java.exe"
set "jar=%~dp0app.jar"
%jre% -jar %jar%
EXIT /B %ERRORLEVEL%

To generate the exe:
packer.exe --arch windows-x64 --input_dir bundle --exec run.cmd --output app.exe

Now run the app.exe, note that the application starts correctly.

Re-pack the exe again ( without changing nothing, just generate the exe again).

When I runing it again I got the error message:

Error: Custom { kind: Other, error: StringError("no tarball found inside binary") }

If I delete all files from C:\Users\<MY WIN USER>\AppData\Local\warp\packages\app.exe\ and run the app.exe again, it starts to working again.

I noted also, that on the second attempt to run the app.exe (and when I get the error), that the app.jar is deleted and not recreated.

I'm using the release v0.3.0

No idea why this worked, but I was encountering the same issue as above when I run a command like this:

warp-packer --arch macos-x64 -i ./bin/release/netcoreapp2.1/osx-x64/publish/ --exec $app_name --output ./deployments/$app_name

And fixed it by adjusting the command to:

warp-packer --arch macos-x64 -i ./bin/release/netcoreapp2.1/osx-x64/publish/ --exec $app_name --output ./deployments/$app_name.bin

For some reason (not familiar enough with rust) it needed a different --output parameter filename than the --exec value.

It's been a while since I used this last, but from what I remember, the issue was something on my side, IIRC. Something about not having permissions to unpack/overwrite (I don't remember very well). The error message was totally not indicative of the actual issue.