jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.14k stars 1.07k forks source link

Error when trying to create a debian package #747

Open Grantlyk opened 10 years ago

Grantlyk commented 10 years ago
fpm -s empty -t deb -n "debtest" -v 1.0

Gives the error:

Process failed: ar failed (exit code 1). Full command was:["ar", "-qc", "/debtest_1.0_amd64.deb", "debian-binary", "control.tar.gz", "/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140805-15576-ypji9z/data.tar.gz"] {:level=>:error}

gnutar as been installed as gtar

jordansissel commented 10 years ago

hmm, ar failed. Weird!

Can you rerun with --debug and paste the output here or in a gist?

Grantlyk commented 10 years ago
Setting from flags: epoch= {:level=>:info, :file=>"fpm/command.rb", :line=>"329"}
Setting from flags: iteration= {:level=>:info, :file=>"fpm/command.rb", :line=>"329"}
Setting from flags: name=debtest {:level=>:info, :file=>"fpm/command.rb", :line=>"329"}
Setting from flags: url=http://example.com/no-uri-given {:level=>:info, :file=>"fpm/command.rb", :line=>"329"}
Setting from flags: version=1.0 {:level=>:info, :file=>"fpm/command.rb", :line=>"329"}
Converting empty to deb {:level=>:info, :file=>"fpm/package.rb", :line=>"192"}
Cleaning up staging path {:path=>"/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-staging20140806-15762-pygwdk", :level=>:debug, :file=>"fpm/package.rb", :line=>"281"}
No deb_installed_size set, calculating now. {:level=>:info, :file=>"fpm/package/deb.rb", :line=>"551"}
Using 'deb.erb' template for the control file {:level=>:debug, :file=>"fpm/package/deb.rb", :line=>"570"}
Reading template {:path=>"/Users/admin/.rvm/gems/ruby-2.0.0-p247/gems/fpm-1.2.0/templates/deb.erb", :level=>:info, :file=>"fpm/package.rb", :line=>"330"}
Writing control file {:path=>"/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/control/control", :level=>:debug, :file=>"fpm/package/deb.rb", :line=>"574"}
Creating {:path=>"/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/control.tar.gz", :from=>"/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/control", :level=>:info, :file=>"fpm/package/deb.rb", :line=>"533"}
Running command {:args=>["gtar", "-C", "/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/control", "-zcf", "/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/control.tar.gz", "--owner=0", "--group=0", "--numeric-owner", "."], :level=>:debug, :file=>"fpm/util.rb", :line=>"59"}
Process is running {:pid=>15769, :level=>:debug, :file=>"fpm/util.rb", :line=>"72"}
Removing no longer needed control dir {:path=>"/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/control", :level=>:debug, :file=>"fpm/package/deb.rb", :line=>"540"}
Running command {:args=>["gtar", "-C", "/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-empty-staging20140806-15762-uf8iw4", "-z", "--numeric-owner", "--owner", "0", "--numeric-owner", "--group", "0", "-cf", "/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/data.tar.gz", "."], :level=>:debug, :file=>"fpm/util.rb", :line=>"59"}
Process is running {:pid=>15776, :level=>:debug, :file=>"fpm/util.rb", :line=>"72"}
Running command {:args=>["ar", "-qc", "/debtest_1.0_amd64.deb", "debian-binary", "control.tar.gz", "/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/data.tar.gz"], :level=>:debug, :file=>"fpm/util.rb", :line=>"59"}
Process is running {:pid=>15778, :level=>:debug, :file=>"fpm/util.rb", :line=>"72"}
ar: /debtest_1.0_amd64.deb: Permission denied {:level=>:info, :file=>"cabin/mixins/pipe.rb", :line=>"46"}
Process failed: ar failed (exit code 1). Full command was:["ar", "-qc", "/debtest_1.0_amd64.deb", "debian-binary", "control.tar.gz", "/var/folders/0l/0qfktrxx1p377cbsg_sfkzch0000gn/T/package-deb-build20140806-15762-12q5asx/data.tar.gz"] {:level=>:error, :file=>"fpm/command.rb", :line=>"439"}

Everything runs fine up until this part

jordansissel commented 10 years ago

Ahha, interesting:

ar: /debtest_1.0_amd64.deb: Permission denied {:level=>:info, :file=>"cabin/mixins/pipe.rb", :line=>"46"}

Something is somehow causing us to run ar with no notion of a temporary folder. Definitely a bug.

Can you tell me what os/distro/version this is? (Looks like a mac given the '/var/folders' thing)

jordansissel commented 10 years ago

I can reproduce your error if my $PWD is / (top level root directory):

% cd /
% fpm -s empty -t deb -n "debtest" -v 1.0
Process failed: ar failed (exit code 1). Full command was:["ar", "-qc", "/debtest_1.0_amd64.deb", "debian-binary", "control.tar.gz", "/var/folders/4r/4fpyt_2d1qvfrgb2fnngrqm40000gn/T/package-deb-build20140805-32315-16mpmn/data.tar.gz"] {:level=>:error}

Can you confirm what pwd outputs just after fpm fails?

Grantlyk commented 10 years ago

I can confirm it is only when I am in my root directory that I get the error

jordansissel commented 10 years ago

Sweet! I can work on improving the error message here to indicate that fpm would fail because $PWD isn't writable.

jordansissel commented 10 years ago

(also, if you have thoughts on what behavior is desirable under this condition, I'm open to it)

Grantlyk commented 10 years ago

The best option would be just to print something more detailed, I can't think of anything else that isn't tacky.

Grantlyk commented 9 years ago

Have you fixed this error yet jordansissel? if not I can go ahead and attempt it

ghost commented 5 years ago

I also hit this issue, the same command success on Ubuntu Desktop 16.04, but failed on Nvidia TX2 Ubuntu 16.04:

fpm -s dir -t deb -v 1.0 -n scheduler --pre-install ./release/script/pre_install_ubuntu.sh --post-install ./release/script/install_ubuntu.sh --before-remove ./release/script/pre_uninstall_ubuntu.sh -C ./release {:timestamp=>"2019-01-21T14:14:05.016867+0800", :message=>"Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag", :level=>:warn} {:timestamp=>"2019-01-21T14:19:13.166251+0800", :message=>"Process failed: ar failed (exit code 1). Full command was:[\"ar\", \"-qc\", \"/home/ubuntu/build_space/workspace/5-scheduler-master-arm64/python/scheduler/scheduler_1.0_arm64.deb\", \"debian-binary\", \"control.tar.gz\", \"/tmp/package-deb-build-836539b134595f13ebe66f073885632766cec9b46bd94eb963321e63e1cb/data.tar.gz\"]", :level=>:error} Makefile:50: recipe for target 'deb' failed

Is there any workaround for this?

ghost commented 5 years ago

I also hit this issue, the same command success on Ubuntu Desktop 16.04, but failed on Nvidia TX2 Ubuntu 16.04:

fpm -s dir -t deb -v 1.0 -n scheduler --pre-install ./release/script/pre_install_ubuntu.sh --post-install ./release/script/install_ubuntu.sh --before-remove ./release/script/pre_uninstall_ubuntu.sh -C ./release {:timestamp=>"2019-01-21T14:14:05.016867+0800", :message=>"Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag", :level=>:warn} {:timestamp=>"2019-01-21T14:19:13.166251+0800", :message=>"Process failed: ar failed (exit code 1). Full command was:["ar", "-qc", "/home/ubuntu/build_space/workspace/5-scheduler-master-arm64/python/scheduler/scheduler_1.0_arm64.deb", "debian-binary", "control.tar.gz", "/tmp/package-deb-build-836539b134595f13ebe66f073885632766cec9b46bd94eb963321e63e1cb/data.tar.gz"]", :level=>:error} Makefile:50: recipe for target 'deb' failed

Is there any workaround for this?

The issue happened when the disk quaota is not enough.

ghost commented 3 years ago

+1

Bug-Reaper commented 2 weeks ago

Hitting this but annoyingly abstracted from fpm b/c electron builder is running it underneath the hood. (M1 MacOS).

message=>"Process failed: ar failed (exit code 1). 
Full command was:[\"ar\", \"-qc\", 
\"/Users/llama/Sorcery/releaseday/soundsafari/dist/soundsafari_0.0.0_arm64.deb\", \"debian-binary\", \"control.tar.gz\", \"/var/folders/lx/3zfzg6xd4_l1lzqbl04kb22h0000gn/T/package-deb-build-d62dc671bc9763d563f276d7e7d6bf8cda1b5ad838a97b1cdf9e19d76e9f/data.tar.xz\"]",
 :level=>:error}

@ghost could you elaborate on the "disk quota" thing and if you found any work-around?