nanobox-io / nanobox-engine-php

Engine for running PHP apps on Nanobox
https://nanobox.io
MIT License
19 stars 15 forks source link

Composer fails due to permission issues #31

Open mbrodala opened 7 years ago

mbrodala commented 7 years ago

When running composer install I see some permission issues:

/app $ composer inst
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Gathering patches for root package.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing typo3/cms (6.2.27)
    Downloading: 100%
    Failed to download typo3/cms from dist: Could not delete /app/typo3_src/6e2e4a4c969f6e0c1ba198d6ebaa60a3:
    Now trying to download from source
  - Installing typo3/cms (6.2.27)
    Cloning d3b7196b87163fb7ab7dc877287883a5df042d4a from cache

On a subsequent composer install the error becomes a bit more verbose:

/app $ composer inst
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Gathering patches for root package.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing typo3/cms (6.2.27)
    Failed to download typo3/cms from dist: Could not delete /app/typo3_src/.git/objects/pack/pack-4289f6325eeeff681eb235e9d8713a4122b49027.idx:
    Now trying to download from source
  - Installing typo3/cms (6.2.27)

  [RuntimeException]
  Could not delete /app/typo3_src/.git/objects/pack/pack-4289f6325eeeff681eb235e9d8713a4122b49027.idx:

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

I am not able to manually delete the mentioned directory:

$ rm -rf typo3_src
rm: cannot remove 'typo3_src/.git/objects/pack/pack-4289f6325eeeff681eb235e9d8713a4122b49027.idx': Operation not permitted
rm: cannot remove 'typo3_src/.git/objects/pack/pack-4289f6325eeeff681eb235e9d8713a4122b49027.pack': Operation not permitted
<hangs for a while>

Only removing it on the host system allows me to remove the directory and brings me back to the state before the first Composer installation.

tylerflint commented 7 years ago

Hi @mbrodala. Thanks for the heads up here.

What OS are you running? Are you using netfs or native? (~/.nanobox/config.yml)

Thanks

mbrodala commented 7 years ago

I'm on Windows 10 and this is my nanobox config:


# provider configuration options (docker-machine|native)
provider: "docker-machine" 

# This next section is used by the docker-machine setup only

# mount type (native|netfs)
mount-type: native

# number of cpus you want docker-machine to have access to
cpus: 4

# number of gigabytes of ram you want docker-machine to use
ram: 4

I've switched to native to avoid the password prompt on launch. It works fine with netfs AFAIS. So do you think this is fixable for native or is this a limitation which cannot be bypassed?

tylerflint commented 7 years ago

@notxarb I'm guessing the native mount is mapping the user to root. We'll need to figure out if we can map the user id properly to the gonano (501?) user id.

@mbrodala With a bit of digging I'm sure we can fix this. As a word of caution, the native driver is very slow and has proven to be unreliable on windows in some scenarios. I think there is an open ticket somewhere about rsync failing to copy files during deploy.

Thanks!