Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1352152

Summary: rpm-ostree compatibility
Product: [Fedora] Fedora Reporter: Colin Walters <walters>
Component: vagrantAssignee: Vít Ondruch <vondruch>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: lmohanty, madam, strzibny, thrcka, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: vagrant-1.8.5-1.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-03 13:25:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1352154    
Attachments:
Description Flags
Write out via create-new-then-rename none

Description Colin Walters 2016-07-01 19:46:27 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1348671
for an example of this elsewhere.

Now I added:
https://github.com/projectatomic/rpm-ostree/pull/364
But vagrant appears to do truncate-in-place:

Jul 01 15:14:02 icarus.verbum.local rpm-ostreed[15270]:         from -e:4:in `<main>'
Jul 01 15:14:02 icarus.verbum.local rpm-ostreed[15270]:         from /usr/share/vagrant/lib/vagrant/plugin/state_file.rb:39:in `add_plugin'
Jul 01 15:14:02 icarus.verbum.local rpm-ostreed[15270]:         from /usr/share/vagrant/lib/vagrant/plugin/state_file.rb:94:in `save!'
Jul 01 15:14:02 icarus.verbum.local rpm-ostreed[15270]:         from /usr/share/vagrant/lib/vagrant/plugin/state_file.rb:94:in `open'
Jul 01 15:14:02 icarus.verbum.local rpm-ostreed[15270]:         from /usr/share/vagrant/lib/vagrant/plugin/state_file.rb:94:in `open'
Jul 01 15:14:02 icarus.verbum.local rpm-ostreed[15270]: /usr/share/vagrant/lib/vagrant/plugin/state_file.rb:94:in `initialize': Read-only file system @ rb_sysopen - /var/lib/vagrant/plugins.json (Errno::EROFS)


So the minimal fix for this is to change the code to do create-new-then-rename, like I did for texinfo (and most other software does).

Additionally,  would be nice to also move the state cache to /usr/lib/vagrant directly in the RPM, so we wouldn't have to carry the change in rpm-ostree.

Comment 1 Vít Ondruch 2016-07-04 10:32:42 UTC
Hi Colin,

Let me think about it, since TBH, I am quite negative about such change. It will be just additional complexity without obvious reasons ...

Also, I'd be much happier, if upstream was using something completely different then this single plugin configuration file. If each plugin had its own configuration file, we would not need to register the plugin neither have something stored in /var.

Just FTR, this is the snipped used in %post section:

http://pkgs.fedoraproject.org/cgit/rpms/vagrant.git/tree/macros.vagrant#n36

and this is where it fails for your use case:

https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/plugin/state_file.rb#L94

Comment 2 Colin Walters 2016-07-06 01:43:15 UTC
Created attachment 1176679 [details]
Write out via create-new-then-rename

Comment 3 Colin Walters 2016-07-06 01:45:34 UTC
Also submitted upstream https://github.com/mitchellh/vagrant/pull/7550

Comment 4 Vít Ondruch 2016-08-03 13:25:34 UTC
This was included in 1.8.5 if I am not mistaken, so this should be part of F25.