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

Bug: cannot remove xhgui during provisioning #1304

Closed
tomcoonen opened this issue Oct 21, 2019 · 14 comments
Closed

Bug: cannot remove xhgui during provisioning #1304

tomcoonen opened this issue Oct 21, 2019 · 14 comments

Comments

@tomcoonen
Copy link

Please note that the Homestead issue tracker is reserved for bug reports and enhancements. We are not always able to debug Vagrant, Provider or Operating System issues, but will do our best to help. Thank you!

Versions

  • Vagrant: 2.2.6
  • Provider: Virtualbox 6.0.14
  • Homestead: 9.2.2

Host operating system

MacOS 10.15

Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
hostname: app1
name: app1
provider: virtualbox

features:
  - mariadb: true
  - python: true
  - ohmyzsh: true

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: "/Users/user/Documents/Projects/app1"
      to: "/home/vagrant/app1"
      type: "nfs"

sites:
    - map: app1.test
      to: "/home/vagrant/app1/public"
      php: "7.3"

databases:
    - app1

variables:
    - key: APP_ENV
      value: local

Vagrant destroy & up output

xxxxx: cannot remove '/home/vagrant/app1/public/xhgui'
xxxxx: : Permission denied
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Expected behavior

Box should be fully provisioned

Actual behavior

Provisioning failed

Steps to reproduce

  1. vagrant destroy
  2. vagrant up
@ndberg
Copy link

ndberg commented Oct 21, 2019

Is this really your path on the host machine: "/Users/user/Documents/Projects/app1"?

It should be you osx user, like: "/Users/tomcoonen/Documents/Projects/app1".

In terminal you can use the pwd command to get the right path for your project.

@tomcoonen
Copy link
Author

@ndberg I replaced some values before posting, it's my username indeed.

@svpernova09
Copy link
Contributor

svpernova09 commented Oct 21, 2019 via email

@vintagesucks
Copy link

I have the same issue. It works flawlessly when I remove type: "nfs" from my Homestead.yaml.

Vagrant: 2.2.6
Provider: Virtualbox 6.0.8
Homestead: 9.2.2
macOS 10.15

Homestead.yaml
ip: 192.168.22.37
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa
folders:
    -
        map: ./
        to: /home/vagrant/code
        type: "nfs"
sites:
    -
        map: debug.test
        to: /home/vagrant/code/public
databases:
    - homestead
features:
    - mariadb: true
    - webdriver: false
name: debug
hostname: debug
debug log excerpt (including cannot remove '/home/vagrant/code/public/xhgui')
DEBUG ssh: Checking key permissions: /Users/nikolas/Documents/GitHub/<removed>/.vagrant/machines/debug/virtualbox/private_key
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: chown -R vagrant /tmp/vagrant-shell (sudo=true)
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: echo; printf $SSH_AUTH_SOCK (sudo=false)
DEBUG ssh: stderr: mesg: 
DEBUG ssh: stderr: ttyname failed
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: stderr: : 
DEBUG ssh: stderr: Inappropriate ioctl for device

 INFO ssh: Setting SSH_AUTH_SOCK remotely: /tmp/ssh-MCeqy2SQCL/agent.2500
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /var/folders/z9/g9xdn4_d6cs73dfhx_nty5kh0000gn/T/vagrant-shell20191021-5073-9wi9qv.ps1 to /tmp/vagrant-shell
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Ensuring remote directory exists for destination upload
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: mkdir -p "/tmp" (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading file /var/folders/z9/g9xdn4_d6cs73dfhx_nty5kh0000gn/T/vagrant-shell20191021-5073-9wi9qv.ps1 to remote /tmp/vagrant-shell
 INFO interface: detail: Running: inline script
 INFO interface: detail:     debug: Running: inline script
    debug: Running: inline script
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: chmod +x '/tmp/vagrant-shell' && /tmp/vagrant-shell (sudo=true)
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: echo; printf $SSH_AUTH_SOCK (sudo=false)
DEBUG ssh: stderr: mesg: ttyname failed: Inappropriate ioctl for device

DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
 INFO ssh: Setting SSH_AUTH_SOCK remotely: /tmp/ssh-MCeqy2SQCL/agent.2500
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: stderr: rm: 
 INFO interface: detail: rm: 
 INFO interface: detail:     debug: rm: 
    debug: rm: 
DEBUG ssh: stderr: cannot remove '/home/vagrant/code/public/xhgui'
 INFO interface: detail: cannot remove '/home/vagrant/code/public/xhgui'
 INFO interface: detail:     debug: cannot remove '/home/vagrant/code/public/xhgui'
    debug: cannot remove '/home/vagrant/code/public/xhgui'
DEBUG ssh: stderr: : Permission denied
 INFO interface: detail: : Permission denied
 INFO interface: detail:     debug: : Permission denied
    debug: : Permission denied
DEBUG ssh: stderr: 

DEBUG ssh: Exit status: 1
ls -lah
total 3560
drwxr-xr-x   46 nikolas  staff   1,4K 21 Okt 18:20 .
drwxr-xr-x   24 nikolas  staff   768B 21 Okt 16:09 ..
-rw-r--r--@   1 nikolas  staff    10K 17 Okt 14:27 .DS_Store
-rw-r--r--    1 nikolas  staff   220B 19 Sep 09:25 .editorconfig
-rw-r--r--    1 nikolas  staff   921B 17 Okt 14:08 .env
-rw-r--r--    1 nikolas  staff   769B 29 Aug 16:22 .env.example
-rw-r--r--    1 nikolas  staff   747B 15 Aug 16:36 .<removed>
drwxr-xr-x   15 nikolas  staff   480B 21 Okt 18:44 .git
-rw-r--r--    1 nikolas  staff   111B 15 Jul 11:28 .gitattributes
-rw-r--r--    1 nikolas  staff   250B 17 Okt 14:28 .gitignore
-rw-rw-r--    1 nikolas  staff   9,6K 19 Sep 11:12 .phpunit.result.cache
drwxr-xr-x    5 nikolas  staff   160B 15 Jul 11:42 .vagrant
drwxr-xr-x    5 nikolas  staff   160B 31 Jul 12:05 .vscode
-rw-r--r--@   1 nikolas  staff   360B 21 Okt 18:40 Homestead.yaml
drwxr-xr-x    9 nikolas  staff   288B 16 Okt 10:12 Modules
-rw-r--r--    1 nikolas  staff   370B  2 Sep 08:34 README.md
-rw-r--r--@   1 nikolas  staff   1,9K 15 Jul 11:28 Vagrantfile
-rw-r--r--    1 nikolas  staff   828B 15 Jul 11:28 after.sh
-rw-r--r--@   1 nikolas  staff   8,4K 15 Jul 11:28 aliases
drwxr-xr-x    8 nikolas  staff   256B  9 Aug 14:03 app
-rw-r--r--@   1 nikolas  staff   1,6K 15 Jul 11:28 artisan
drwxr-xr-x    4 nikolas  staff   128B 15 Jul 11:28 bootstrap
-rw-r--r--    1 nikolas  staff   2,5K 17 Okt 09:49 composer.json
-rw-r--r--@   1 nikolas  staff   309K 17 Okt 09:52 composer.lock
drwxr-xr-x   21 nikolas  staff   672B 19 Sep 09:25 config
drwxr-xr-x    7 nikolas  staff   224B 17 Okt 10:40 cypress
-rw-r--r--    1 nikolas  staff    84B 17 Okt 11:45 cypress.env.json
-rw-r--r--@   1 nikolas  staff    58B 17 Okt 12:46 cypress.env.json.example
-rw-r--r--    1 nikolas  staff     3B 17 Okt 10:38 cypress.json
drwxr-xr-x    6 nikolas  staff   192B 15 Jul 11:28 database
-rw-r--r--    1 nikolas  staff   704K 21 Okt 18:25 debug_log
drwxr-xr-x  805 nikolas  staff    25K 17 Okt 14:18 node_modules
-rw-r--r--    1 nikolas  staff   1,3K 17 Okt 14:26 package.json
-rw-r--r--@   1 nikolas  staff   505B 19 Sep 09:38 phpstan.neon
-rw-r--r--    1 nikolas  staff   1,9K 19 Sep 11:08 phpunit.xml
drwxr-xr-x   13 nikolas  staff   416B 19 Sep 09:25 public
drwxr-xr-x    6 nikolas  staff   192B 28 Aug 14:16 resources
drwxr-xr-x    6 nikolas  staff   192B 15 Jul 11:28 routes
-rw-r--r--    1 nikolas  staff   563B 15 Jul 11:28 server.php
drwxr-xr-x    5 nikolas  staff   160B 15 Jul 11:28 storage
drwxr-xr-x    8 nikolas  staff   256B 19 Sep 09:25 tests
drwxr-xr-x   76 nikolas  staff   2,4K 17 Okt 09:52 vendor
-rw-r--r--    1 nikolas  staff   824B 17 Okt 14:26 webpack.mix.js
-rw-r--r--@   1 nikolas  staff   1,1K 15 Aug 16:41 wercker.yml
-rw-r--r--    1 nikolas  staff   322K 17 Okt 13:20 yarn-error.log
-rw-r--r--@   1 nikolas  staff   305K 17 Okt 14:26 yarn.lock

@svpernova09
Copy link
Contributor

@vintagesucks Thanks, i'm betting it's a NFS/Permissions issue.

Thanks for pasting your files, could you run ls -lah from the public folder there, trying to see the ownership/group of all those files. maybe we're doing something weird with the xhgui feature.

@vintagesucks
Copy link

vintagesucks commented Oct 21, 2019

@svpernova09 👀

vagrant@debug:~$ cd /home/vagrant/code/public
-bash: cd: /home/vagrant/code/public: Permission denied
vagrant@debug:~$ cd /home/vagrant/code/
vagrant@debug:~/code$ ls -lah
ls: cannot open directory '.': Stale file handle
vagrant@debug:~/code$ cd
vagrant@debug:~$ ls -lah
ls: cannot access 'code': Stale file handle
total 76K
drwxr-xr-x 11 vagrant vagrant 4.0K Oct 21 16:52 .
drwxr-xr-x  3 root    root    4.0K Sep 29 12:36 ..
-rw-r--r--  1 root    root    8.4K Oct 21 16:52 .bash_aliases
-rw-r--r--  1 vagrant vagrant  220 Sep 29 12:36 .bash_logout
-rw-r--r--  1 vagrant vagrant 3.7K Sep 29 12:36 .bashrc
drwx------  3 vagrant vagrant 4.0K Sep 29 12:55 .cache
d?????????  ? ?       ?          ?            ? code
drwxrwxr-x  4 vagrant vagrant 4.0K Sep 29 12:56 .composer
drwxr-xr-x  5 vagrant vagrant 4.0K Sep 29 12:51 .config
drwx------  3 vagrant vagrant 4.0K Sep 29 12:37 .gnupg
drwxr-xr-x  2 vagrant vagrant 4.0K Oct 21 16:52 .homestead-features
drwxr-xr-x  3 vagrant vagrant 4.0K Sep 29 12:55 .local
-rw-r--r--  1 vagrant vagrant   67 Sep 29 12:53 .my.cnf
drwxr-xr-x  4 vagrant vagrant 4.0K Sep 29 12:52 .npm
-rw-r--r--  1 vagrant vagrant  856 Sep 29 12:56 .profile
drwx------  2 vagrant vagrant 4.0K Oct 21 16:52 .ssh
-rw-r--r--  1 vagrant vagrant    0 Sep 29 12:37 .sudo_as_admin_successful
-rw-r--r--  1 vagrant vagrant    5 Sep 29 12:37 .vbox_version
-rw-r--r--  1 vagrant vagrant  297 Sep 29 12:55 .wget-hsts

@svpernova09
Copy link
Contributor

Oh neat

d????????? ? ? ? ? ? code

@vintagesucks @tomcoonen, To ensure this isn't Homestead's fault, can one of you edit this line in your Homestead folder: https://github.com/laravel/homestead/blob/master/scripts/homestead.rb#L364

to:

s.inline = 'su vagrant -c "ln -sf /opt/xhgui/webroot ' + site['to'] + '/xhgui"'

I think I got my string interpolation correct. Essentially we want to run that ln line AS vagrant,

If this resolves the issue, then I'll make this change, if it doesn't, and we can still confirm after this the folder is broken as above, it may be NFS (and outside of our ability to fix)

@vintagesucks
Copy link

vintagesucks commented Oct 22, 2019

@svpernova09 That change unfortunately did not solve the issue for me. I'd be happy to try or investigate further things.

Maybe related to hashicorp/vagrant#8704 or hashicorp/vagrant#11134? Also: One comment over there mentioned something related to the use of external (USB) drives. I currently happen to use one as my boot volume, too.

So yeah, probably a permissions issue then.

@svpernova09
Copy link
Contributor

I'll try to take a look at this in the next day or two. I'm away at a conference atm.

@vintagesucks
Copy link

@svpernova09 Huh! I got it to work by granting Full Disk Access to /sbin/nfsd.

ls -lah now results in the following for the code folder:

drwxr-xr-x 46     501 dialout 1.5K Oct 21 16:20 code

Add /sbin/nfsd in System Preferences > Security & Privacy > Privacy > Full Disk Access

Click on the plus sign to add a program and then you can navigate to the /sbin folder by pressing Command-Shift-G. (edit) I noticed that I didn't specify that this is on the Privacy tab.

@svpernova09
Copy link
Contributor

Ah! this makes sense. Good to know!

Glad you got it sorted out.

@Pierre-FoodspringGmbH
Copy link

@vintagesucks THANK YOU!!! Works as a charm!

@tomcoonen
Copy link
Author

@vintagesucks works indeed, thanks!

@nathan-fiscaletti
Copy link

@vintagesucks your fix also seemed to resolve my issue over at hashicorp/vagrant#11134 ! Thanks!

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

6 participants