Skip to content
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

Can't build OctoPi with Mac OS X #388

Closed
klcjr89 opened this issue Jul 19, 2017 · 15 comments
Closed

Can't build OctoPi with Mac OS X #388

klcjr89 opened this issue Jul 19, 2017 · 15 comments

Comments

@klcjr89
Copy link

klcjr89 commented Jul 19, 2017

Hello, ever since the file structure changed with the latest devel commits I am not able to build OctoPi anymore, and the instructions are pretty vague in the README.rst file in the root folder and they don't work for me using the latest Mac OS X Sierra 10.12.5.

I remember getting it setup initially with vagrant was quite a chore even before the changes, but I think it needs to be made easier to make/build the OctoPi img file such as double clicking on a .sh file or revising the readme file to give more clear instructions for Windows and OS X alike.

I would greatly appreciate help on this. :)

Thank you!

@guysoft
Copy link
Owner

guysoft commented Jul 19, 2017

I didn't know you could build it using a mac. Good to know!
Since I did't test it for mac, its likely I changed something that works differently.

Can you post what you are trying to do, and what error you aarw getting?
I need some more details how you are actually building with mac to support it.
Output with errors would help!

@klcjr89
Copy link
Author

klcjr89 commented Jul 19, 2017

I don't remember how I got it work originally, since I had help from an amazon developer that lives across the country. I just remember having to use vagrant and finding the suitable Mac alternatives for apt-get and mod-probe nfs, etc that was mentioned in the readme.

It would be super helpful if we can figure out a way to make clickable script files that create the OctoPi img automagically for the large platforms: Mac, Windows.

That is my ideal dream instead of having to use the terminal everytime to cd and sudo up / provision etc.

Thank you for your work creating OctoPi!

@klcjr89
Copy link
Author

klcjr89 commented Jul 19, 2017

I was able to find the conversation my friend and I had on how we got it working originally.

  1. Download & install Vagrant: https://www.vagrantup.com/downloads.html

  2. In the OS X Terminal: sudo vagrant plugin install vagrant-share

  3. sudo vagrant plugin install vagrant-nfs_guest

  4. cd OctoPi/src/vagrant

  5. sudo vagrant up

or if already provisioned, sudo vagrant provision

And step 5 automatically built the .img file, which was recently removed in the commit: bacf064

I noticed you also changed the 'Vagrantfile' quite a bit from before.

The original one below worked:

Vagrant.configure("2") do |o| # o.vm.box = "octopi-build" o.vm.box= "ubuntu/zesty64" o.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" o.vm.synced_folder "../../", "/OctoPi", create:true, type: "nfs" o.vm.network :private_network, ip: "192.168.55.55" o.vm.provision :shell, :path => "setup.sh", args: ENV['SHELL_ARGS'] end

The new Vagrantfile in the latest commits results in these errors in the Terminal:
Users-MacBook-Pro:~ user$ cd OctoPi/src/vagrant
Users-MacBook-Pro:vagrant user$ sudo vagrant up
Password:
/Users/User/OctoPi/src/vagrant/Vagrantfile:6:in read': No such file or directory @ rb_sysopen - ../custompios_path (Errno::ENOENT) from /Users/User/OctoPi/src/vagrant/Vagrantfile:6:in block in <top (required)>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/config/v2/loader.rb:37:in load' from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/config/loader.rb:125:in block (2 levels) in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/config/loader.rb:119:in each' from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/config/loader.rb:119:in block in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/config/loader.rb:116:in each' from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/config/loader.rb:116:in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/vagrantfile.rb:28:in initialize' from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/environment.rb:810:in new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/environment.rb:810:in vagrantfile' from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/environment.rb:556:in host'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/environment.rb:214:in block in action_runner' from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/action/runner.rb:33:in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/environment.rb:543:in hook' from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/lib/vagrant/environment.rb:792:in unload'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/bin/vagrant:141:in ensure in <main>' from /opt/vagrant/embedded/gems/gems/vagrant-1.9.7/bin/vagrant:141:in

'

@guysoft
Copy link
Owner

guysoft commented Jul 19, 2017

Ok.
So:

  1. You need to run ../../CustomPiOS/src/update-custompios-paths as stated in the readme. In case you didn't you need to git clone CustomPiOS too now, see the README.
  2. I removed the build command from the provision command, because its two seprate parts, so you need to use now vagrant/run_vagrant_build.sh after you run sudo vagrant up.

Hope that helps, post if you have any issues.
It seems like its just you didn't see the new build steps that were added.

@klcjr89
Copy link
Author

klcjr89 commented Jul 19, 2017

I have no idea how to setup PiOS. It was nice that everything was within one repo before. If we can get to the point of avoiding the terminal and making an executable file you click on to build the images we are golden.

Edit 1: Just cloned PiOS, the only place in the OctoPi Readme it says ../../CustomPiOS/src/update-custompios-paths is for Debian, etc and not Vagrant.

Seriously cannot figure this out :(

@guysoft
Copy link
Owner

guysoft commented Jul 19, 2017

Its CustomPiOS. The reason is its a separate repo is because its a complete toolkit to build OSes now.
I'll update the readme to include it also to say so for vagrant.

All that script does is add the path of CustomPiOS in custompios_path, which you can see in your vagrant its complaining about.

@klcjr89
Copy link
Author

klcjr89 commented Jul 19, 2017

Ok I got farther this time, and now this error/issue has appeared in the Terminal output:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp 192.168.55.1:/Users/Ken/CustomPiOS/src /CustomPiOS

Stdout from the command:

Stderr from the command:

mount.nfs: requested NFS version or transport protocol is not supported

@guysoft
Copy link
Owner

guysoft commented Jul 19, 2017

Ok, so good news and bad news.
The good new is your a not alone, its a common OS X error and you can see it here:
hashicorp/vagrant#7646

The bad news is that there are several possible causes. After reading it the mains ones that stand out are:

  1. Someone writes: "I had 127.0.0.1 localhost commented out in my /etc/hosts file on my mac and I uncommented it and now nfs mounting works." - two users at the end report this fixes the issue for them.
  2. Try rebooting your NFS might be stuck
  3. Try figuring out if you have NFS 3 or 4. If its 4 you might need to update the Vagrantfile to include a 4 and not a 3.

@klcjr89
Copy link
Author

klcjr89 commented Jul 19, 2017

Looks like there was an extraneous newline character added to the custompios_path file which generated the above error, before you replied I typed this comment. I didn't experience what you described above, but I can confirm the newline character is what caused the previous issue I posted.

However, I have ran into a new issue:

==> default: Setting up realpath (8.26-3ubuntu3) ...
==> default: Setting up zip (3.0-11) ...
==> default: Processing triggers for systemd (232-21ubuntu5) ...
==> default: Setting up qemu-user-static (1:2.8+dfsg-3ubuntu2.3) ...
==> default: Processing triggers for man-db (2.7.6.1-2) ...
Kens-MacBook-Pro:vagrant Ken$ run_vagrant_build
-bash: run_vagrant_build: command not found
-bash: run_vagrant_build.sh: command not found
Kens-MacBook-Pro:vagrant Ken$

@guysoft
Copy link
Owner

guysoft commented Jul 19, 2017

try ./run_vagrant_build.sh
Note it has a .sh and that some POSIX distros need the ./ at the beginning.

@klcjr89
Copy link
Author

klcjr89 commented Jul 19, 2017

That worked, it appears to be building now. Crosses fingers.

@klcjr89
Copy link
Author

klcjr89 commented Jul 19, 2017

I'm assuming I can make all of the above into a seperate .sh file I can just click on whenever I want to build an image.

@guysoft
Copy link
Owner

guysoft commented Jul 19, 2017

Sure.
Script what ever you want and share it :)
We are using Jenkins for continuous builds

@klcjr89
Copy link
Author

klcjr89 commented Jul 19, 2017

What about that newline character I mentioned, can this be patched in a new commit for OctoPi?

Maybe add a command to remove any newline in the file at the end of the script.

@klcjr89 klcjr89 closed this as completed Jul 19, 2017
@klcjr89
Copy link
Author

klcjr89 commented Jul 20, 2017

Update: nevermind about that newline character, It wasn't an issue at all. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants