Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Fails with Permission denied on blt.sh #616

Closed
mospeed opened this issue Nov 1, 2016 · 6 comments
Closed

Fails with Permission denied on blt.sh #616

mospeed opened this issue Nov 1, 2016 · 6 comments

Comments

@mospeed
Copy link

mospeed commented Nov 1, 2016

Hi

I am trying to follow the steps as mentioned to create a new BLT project. After all dependencies have been loaded the script stops with the following error

`root@8bbd0c19f463:/var/www/html# composer create-project acquia/blt-project startblt --no-interaction
1/7: http://packagist.org/p/provider-2016-01$533beef8b1ca068d2729d4286d6ac28a899aed77b3dfbd6676cc108df560e607.json
2/7: http://packagist.org/p/provider-2014$176fec68bf3c96c7fed4bfa546ec9890ae8f474a9eeb010d32dcc484d2fb0544.json
3/7: http://packagist.org/p/provider-2015$0d78662c8d6ce8ba1555e3d2b82cd7fda6a48c7040fdfbfa07d8e0f6be569611.json
4/7: http://packagist.org/p/provider-latest$f6f96711c1de2030675aaa888d1ccad95fcf34f6a83fb1a99ce0c8104ad8d3b2.json
5/7: http://packagist.org/p/provider-2016-10$3ed386425afa0eaa012ba5edd37f61c818d938847d49aed08ea45353c91505da.json
6/7: http://packagist.org/p/provider-2016-07$d3976f256b410d6957629c6b6aec29909563efbc473a776fcc7b3fdc573d1e12.json
7/7: http://packagist.org/p/provider-2016-04$41854c0f13d45699d9beaf4281bf23cf1cfd5f62c83c35e8e6b65f1b8c5e7d09.json
Finished: success: 7, skipped: 0, failure: 0, total: 7
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Installing acquia/blt-project (8.0.2)

  • Installing acquia/blt-project (8.0.2)
    Loading from cache

Created project in startblt
1/1: http://packagist.org/p/provider-latest$8cafbb0e2332e6b8a537191e27bd66e316afa8f1818bbca080abb9c070583d1e.json
Finished: success: 1, skipped: 0, failure: 0, total: 1
Loading composer repositories with package information
Updating dependencies (including require-dev)

  • Installing composer/installers (v1.2.0)
    Loading from cache

  • Installing twig/twig (v1.27.0)
    Loading from cache

  • Installing symfony/polyfill-mbstring (v1.2.0)
    Loading from cache

  • Installing symfony/twig-bridge (v2.8.13)
    Loading from cache

  • Installing psr/log (1.0.2)
    Loading from cache

  • Installing symfony/debug (v2.8.13)
    Loading from cache

  • Installing symfony/console (v2.8.13)
    Loading from cache

  • Installing symfony/yaml (v2.8.13)
    Loading from cache

  • Installing squizlabs/php_codesniffer (2.7.0)
    Loading from cache

  • Installing sebastian/version (2.0.0)
    Loading from cache

  • Installing sebastian/resource-operations (1.0.0)
    Loading from cache

  • Installing sebastian/recursion-context (1.0.2)
    Loading from cache

  • Installing sebastian/object-enumerator (1.0.0)
    Loading from cache

  • Installing sebastian/global-state (1.1.1)
    Loading from cache

  • Installing sebastian/exporter (1.2.2)
    Loading from cache

  • Installing sebastian/environment (1.3.8)
    Loading from cache

  • Installing sebastian/diff (1.4.1)
    Loading from cache

  • Installing sebastian/comparator (1.2.0)
    Loading from cache

  • Installing phpunit/php-text-template (1.2.1)
    Loading from cache

  • Installing doctrine/instantiator (1.0.5)
    Loading from cache

  • Installing phpunit/phpunit-mock-objects (3.4.0)
    Loading from cache

  • Installing phpunit/php-timer (1.0.8)
    Loading from cache

  • Installing phpunit/php-file-iterator (1.4.1)
    Loading from cache

  • Installing sebastian/code-unit-reverse-lookup (1.0.0)
    Loading from cache

  • Installing phpunit/php-token-stream (1.4.8)
    Loading from cache

  • Installing phpunit/php-code-coverage (4.0.2)
    Loading from cache

  • Installing webmozart/assert (1.1.0)
    Loading from cache

  • Installing phpdocumentor/reflection-common (1.0)
    Loading from cache

  • Installing phpdocumentor/type-resolver (0.2)
    Loading from cache

  • Installing phpdocumentor/reflection-docblock (3.1.1)
    Loading from cache

  • Installing phpspec/prophecy (v1.6.1)
    Loading from cache

  • Installing myclabs/deep-copy (1.5.5)
    Loading from cache

  • Installing phpunit/phpunit (5.6.2)
    Loading from cache

  • Installing phing/phing (2.15.2)
    Loading from cache

  • Installing symfony/translation (v2.8.13)
    Loading from cache

  • Installing ircmaxell/password-compat (v1.0.4)
    Loading from cache

  • Installing symfony/polyfill-php55 (v1.2.0)
    Loading from cache

  • Installing symfony/polyfill-php54 (v1.2.0)
    Loading from cache

  • Installing symfony/http-foundation (v2.8.13)
    Loading from cache

  • Installing symfony/finder (v2.8.13)
    Loading from cache

  • Installing symfony/filesystem (v2.8.13)
    Loading from cache

  • Installing symfony/event-dispatcher (v2.8.13)
    Loading from cache

  • Installing symfony/dom-crawler (v2.8.13)
    Loading from cache

  • Installing symfony/dependency-injection (v2.8.13)
    Loading from cache

  • Installing symfony/css-selector (v2.8.13)
    Loading from cache

  • Installing symfony/config (v2.8.13)
    Loading from cache

  • Installing stecman/symfony-console-completion (0.5.1)
    Loading from cache

  • Installing phpseclib/phpseclib (2.0.4)
    Loading from cache

  • Installing padraic/humbug_get_contents (1.0.4)
    Loading from cache

  • Installing padraic/phar-updater (1.0.3)
    Loading from cache

  • Installing guzzlehttp/promises (1.2.0)
    Loading from cache

  • Installing psr/http-message (1.0.1)
    Loading from cache

  • Installing guzzlehttp/psr7 (1.3.1)
    Loading from cache

  • Installing guzzlehttp/guzzle (6.2.2)
    Loading from cache

  • Installing gabordemooij/redbean (v4.3.2)
    Loading from cache

  • Installing doctrine/lexer (v1.0.1)
    Loading from cache

  • Installing doctrine/annotations (v1.2.7)
    Loading from cache

  • Installing dflydev/placeholder-resolver (v1.0.2)
    Loading from cache

  • Installing symfony/process (v3.1.6)
    Loading from cache

  • Installing doctrine/collections (v1.3.0)
    Loading from cache

  • Installing alchemy/zippy (0.3.5)
    Loading from cache

  • Installing drupal/console (1.0.0-beta5)
    Loading from cache

  • Installing drupal/coder (8.2.9)
    Loading from cache

  • Installing dflydev/dot-access-data (v1.0.1)
    Loading from cache

  • Installing acquia/blt (8.5.0)
    Loading from cache

symfony/twig-bridge suggests installing symfony/asset (For using the AssetExtension)
symfony/twig-bridge suggests installing symfony/expression-language (For using the ExpressionExtension)
symfony/twig-bridge suggests installing symfony/form (For using the FormExtension)
symfony/twig-bridge suggests installing symfony/http-kernel (For using the HttpKernelExtension)
symfony/twig-bridge suggests installing symfony/routing (For using the RoutingExtension)
symfony/twig-bridge suggests installing symfony/security (For using the SecurityExtension)
symfony/twig-bridge suggests installing symfony/stopwatch (For using the StopwatchExtension)
symfony/twig-bridge suggests installing symfony/templating (For using the TwigEngine)
symfony/twig-bridge suggests installing symfony/var-dumper (For using the DumpExtension)
sebastian/global-state suggests installing ext-uopz ()
phpunit/phpunit-mock-objects suggests installing ext-soap (
)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.4.0)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
phing/phing suggests installing phpdocumentor/phpdocumentor (Documentation Generator for PHP)
phing/phing suggests installing sebastian/phpcpd (Copy/Paste Detector (CPD) for PHP code)
phing/phing suggests installing phpmd/phpmd (PHP version of PMD tool)
phing/phing suggests installing pdepend/pdepend (PHP version of JDepend)
phing/phing suggests installing phploc/phploc (A tool for quickly measuring the size of a PHP project)
phing/phing suggests installing pear/versioncontrol_svn (A simple OO-style interface for Subversion, the free/open-source version control system)
phing/phing suggests installing pear/versioncontrol_git (A library that provides OO interface to handle Git repository)
phing/phing suggests installing pear/archive_tar (Tar file management class)
phing/phing suggests installing siad007/versioncontrol_hg (A library for interfacing with Mercurial repositories.)
phing/phing suggests installing tedivm/jshrink (Javascript Minifier built in PHP)
symfony/event-dispatcher suggests installing symfony/http-kernel ()
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.)
phpseclib/phpseclib suggests installing ext-mcrypt (Install the Mcrypt extension in order to speed up a few other cryptographic operations.)
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic
operations.)
alchemy/zippy suggests installing guzzle/guzzle (To use the GuzzleTeleporter)
acquia/blt suggests installing hirak/prestissimo (^0.3)
Writing lock file
Generating autoload files
Updating BLT templated files
This may have modified your composer.json and require a subsequent composer update

rm -f .travis.yml
rm -f README.md
rm -f LICENSE.txt
blt create-project
/var/www/html/startblt/vendor/bin/blt: line 10: ./vendor/acquia/blt/blt.sh: Permission denied
Script blt create-project handling the post-create-project-cmd event returned with error code 126`

Please provide pointers towards identifying and solving this issue.

thanks in advance

@grasmash
Copy link
Contributor

grasmash commented Nov 1, 2016

I notice Do not run Composer as root/super user! in your output. You should not be running these commands as root. You are likely experiencing issues with file permissions due to this. Please use a non-root user and try again.

@mospeed
Copy link
Author

mospeed commented Nov 1, 2016

Thanks for your response.
Here is another run, this time with non-root user but same result

app@8bbd0c19f463:~$ composer create-project acquia/blt-project startblt --no-interaction
Installing acquia/blt-project (8.0.2)
  - Installing acquia/blt-project (8.0.2)
    Downloading: 100%

Created project in startblt
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing composer/installers (v1.2.0)
    Downloading: 100%

  - Installing twig/twig (v1.27.0)
    Downloading: 100%

  - Installing symfony/polyfill-mbstring (v1.2.0)
    Downloading: 100%

  - Installing symfony/twig-bridge (v2.8.13)
    Downloading: 100%

  - Installing psr/log (1.0.2)
    Downloading: 100%

  - Installing symfony/debug (v2.8.13)
    Downloading: 100%

  - Installing symfony/console (v2.8.13)
    Downloading: 100%

  - Installing symfony/yaml (v2.8.13)
    Downloading: 100%

  - Installing squizlabs/php_codesniffer (2.7.0)
    Downloading: 100%

  - Installing sebastian/version (2.0.0)
    Downloading: 100%

  - Installing sebastian/resource-operations (1.0.0)
    Downloading: 100%

  - Installing sebastian/recursion-context (1.0.2)
    Downloading: 100%

  - Installing sebastian/object-enumerator (1.0.0)
    Downloading: 100%

  - Installing sebastian/global-state (1.1.1)
    Downloading: 100%

  - Installing sebastian/exporter (1.2.2)
    Downloading: 100%

  - Installing sebastian/environment (1.3.8)
    Downloading: 100%

  - Installing sebastian/diff (1.4.1)
    Downloading: 100%

  - Installing sebastian/comparator (1.2.0)
    Downloading: 100%

  - Installing phpunit/php-text-template (1.2.1)
    Downloading: 100%

  - Installing doctrine/instantiator (1.0.5)
    Downloading: 100%

  - Installing phpunit/phpunit-mock-objects (3.4.0)
    Downloading: 100%

  - Installing phpunit/php-timer (1.0.8)
    Downloading: 100%

  - Installing phpunit/php-file-iterator (1.4.1)
    Downloading: 100%

  - Installing sebastian/code-unit-reverse-lookup (1.0.0)
    Downloading: 100%

  - Installing phpunit/php-token-stream (1.4.8)
    Downloading: 100%

  - Installing phpunit/php-code-coverage (4.0.2)
    Downloading: 100%

  - Installing webmozart/assert (1.1.0)
    Downloading: 100%

  - Installing phpdocumentor/reflection-common (1.0)
    Downloading: 100%

  - Installing phpdocumentor/type-resolver (0.2)
    Downloading: 100%

  - Installing phpdocumentor/reflection-docblock (3.1.1)
    Downloading: 100%

  - Installing phpspec/prophecy (v1.6.1)
    Downloading: 100%

  - Installing myclabs/deep-copy (1.5.5)
    Downloading: 100%

  - Installing phpunit/phpunit (5.6.2)
    Downloading: 100%

  - Installing phing/phing (2.15.2)
    Downloading: 100%

  - Installing symfony/translation (v2.8.13)
    Downloading: 100%

  - Installing ircmaxell/password-compat (v1.0.4)
    Downloading: 100%

  - Installing symfony/polyfill-php55 (v1.2.0)
    Downloading: 100%

  - Installing symfony/polyfill-php54 (v1.2.0)
    Downloading: 100%

  - Installing symfony/http-foundation (v2.8.13)
    Downloading: 100%

  - Installing symfony/finder (v2.8.13)
    Downloading: 100%

  - Installing symfony/filesystem (v2.8.13)
    Downloading: 100%

  - Installing symfony/event-dispatcher (v2.8.13)
    Downloading: 100%

  - Installing symfony/dom-crawler (v2.8.13)
    Downloading: 100%

  - Installing symfony/dependency-injection (v2.8.13)
    Downloading: 100%

  - Installing symfony/css-selector (v2.8.13)
    Downloading: 100%

  - Installing symfony/config (v2.8.13)
    Downloading: 100%

  - Installing stecman/symfony-console-completion (0.5.1)
    Downloading: 100%

  - Installing phpseclib/phpseclib (2.0.4)
    Downloading: 100%

  - Installing padraic/humbug_get_contents (1.0.4)
    Downloading: 100%

  - Installing padraic/phar-updater (1.0.3)
    Downloading: 100%

  - Installing guzzlehttp/promises (1.2.0)
    Downloading: 100%

  - Installing psr/http-message (1.0.1)
    Downloading: 100%

  - Installing guzzlehttp/psr7 (1.3.1)
    Downloading: 100%

  - Installing guzzlehttp/guzzle (6.2.2)
    Downloading: 100%

  - Installing gabordemooij/redbean (v4.3.2)
    Downloading: 100%

  - Installing doctrine/lexer (v1.0.1)
    Downloading: 100%

  - Installing doctrine/annotations (v1.2.7)
    Downloading: 100%

  - Installing dflydev/placeholder-resolver (v1.0.2)
    Downloading: 100%

  - Installing symfony/process (v3.1.6)
    Downloading: 100%

  - Installing doctrine/collections (v1.3.0)
    Downloading: 100%

  - Installing alchemy/zippy (0.3.5)
    Downloading: 100%

  - Installing drupal/console (1.0.0-beta5)
    Downloading: 100%

  - Installing drupal/coder (8.2.9)
    Downloading: 100%

  - Installing dflydev/dot-access-data (v1.0.1)
    Downloading: 100%

  - Installing acquia/blt (8.5.0)
    Downloading: 100%

symfony/twig-bridge suggests installing symfony/asset (For using the AssetExtension)
symfony/twig-bridge suggests installing symfony/expression-language (For using the ExpressionExtension)
symfony/twig-bridge suggests installing symfony/form (For using the FormExtension)
symfony/twig-bridge suggests installing symfony/http-kernel (For using the HttpKernelExtension)
symfony/twig-bridge suggests installing symfony/routing (For using the RoutingExtension)
symfony/twig-bridge suggests installing symfony/security (For using the SecurityExtension)
symfony/twig-bridge suggests installing symfony/stopwatch (For using the StopwatchExtension)
symfony/twig-bridge suggests installing symfony/templating (For using the TwigEngine)
symfony/twig-bridge suggests installing symfony/var-dumper (For using the DumpExtension)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.4.0)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
phing/phing suggests installing phpdocumentor/phpdocumentor (Documentation Generator for PHP)
phing/phing suggests installing sebastian/phpcpd (Copy/Paste Detector (CPD) for PHP code)
phing/phing suggests installing phpmd/phpmd (PHP version of PMD tool)
phing/phing suggests installing pdepend/pdepend (PHP version of JDepend)
phing/phing suggests installing phploc/phploc (A tool for quickly measuring the size of a PHP project)
phing/phing suggests installing pear/versioncontrol_svn (A simple OO-style interface for Subversion, the free/open-source version control system)
phing/phing suggests installing pear/versioncontrol_git (A library that provides OO interface to handle Git repository)
phing/phing suggests installing pear/archive_tar (Tar file management class)
phing/phing suggests installing siad007/versioncontrol_hg (A library for interfacing with Mercurial repositories.)
phing/phing suggests installing tedivm/jshrink (Javascript Minifier built in PHP)
symfony/event-dispatcher suggests installing symfony/http-kernel ()
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.)
phpseclib/phpseclib suggests installing ext-mcrypt (Install the Mcrypt extension in order to speed up a few other cryptographic operations.)
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic
operations.)
alchemy/zippy suggests installing guzzle/guzzle (To use the GuzzleTeleporter)
acquia/blt suggests installing hirak/prestissimo (^0.3)
Writing lock file
Generating autoload files
Updating BLT templated files
This may have modified your composer.json and require a subsequent `composer update`
> rm -f .travis.yml
> rm -f README.md
> rm -f LICENSE.txt
> blt create-project
/home/app/startblt/vendor/bin/blt: line 10: ./vendor/acquia/blt/blt.sh: Permission denied
Script blt create-project handling the post-create-project-cmd event returned with error code 126

@grasmash
Copy link
Contributor

grasmash commented Nov 1, 2016

Yeah that's strange. Apparently your current user doesn't have execute permissions on /home/app/startblt/vendor/acquia/blt/blt.sh. Can you check the permissions and ownership of that file? This is an issue with your local machine's users, groups, and permissions. You should be able to solve it with either changes to ownership or changes to permissions via chown and chmod.

I'm not sure what would cause your composer downloaded files to have insufficient permissions in the first place. You may have installed composer or git using a root account. Perhaps re-installing those tools without a root account would solve it.

@mospeed
Copy link
Author

mospeed commented Nov 2, 2016

thats right. When i run all commands with root, blt.sh does not get execute permission automatically. if i manually provide execute permission what is the next step?

I also created a new user, added it to www-data group and installed all the dependencies with this user, wherever possible, and with sudo where root permission was required. Now when i try to create a new project with this new user it straightaway gives me Permission denied as shown below. with sudo outut is same as i mentioned above.

`app@21e8db9b15f3:/var/www/html$ composer create-project acquia/blt-project startblt --no-interaction
1/9: http://packagist.org/p/provider-archived$daf07fc0a0752d691e65a13dc7300539d9d41aebcd9c42b16462d57577a3953b.json
2/9: http://packagist.org/p/provider-latest$1457a1a64828c4e4d526188b83171f5824a03bd998a54ae9d1ec5a599c58894b.json
3/9: http://packagist.org/p/provider-2013$34454482d40d3600561d085ef5ad0c231c337d43af4588b9790bb296275a5434.json
4/9: http://packagist.org/p/provider-2016-10$558082a06ee27393c0db5e3b6bac5f5ea2c39a7615e839843b6fcbc52edbce26.json
5/9: http://packagist.org/p/provider-2016-04$0c8aeb2b0140690f15ab407294e631335d9e891434d776e9863c36b42fedff0d.json
6/9: http://packagist.org/p/provider-2016-07$6491b833f18371a66e71d1bc429c3bbba991a19aa76066f4b2e4ad56069d5372.json
7/9: http://packagist.org/p/provider-2014$e03e0c0af8a4703782c2ffc356012b065f176cd2d43eff370def9a23b2fb5f8b.json
8/9: http://packagist.org/p/provider-2016-01$eddcb64923f0fefea597c97e0dff38c9ae89ddaa8c4800fc49663c46bdaeaec7.json
9/9: http://packagist.org/p/provider-2015$10b0b532d16f914367f9319677cf5d499d84ccf5c935d9131a5665a0586765b6.json
Finished: success: 9, skipped: 0, failure: 0, total: 9
Installing acquia/blt-project (8.0.2)

[ErrorException]
mkdir(): Permission denied

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no
-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [] [] []`

@grasmash
Copy link
Contributor

grasmash commented Nov 2, 2016

Unfortunately, I don't think there's too much I can do to assist you. Both of the errors that you've described as caused by your user having insufficient permissions to write and to execute files. The problem and the solution are specific to your machine.

The user executing commands must have access to write and execute all files within the project directory. If you make that the case, you should be good to go.

Some stackoverflow issues that might help you:

Also, in response to "sudo where root permission was required", sudo is not required when running composer and BLT commands. If you're prompted for sudo access, there's a permissions issue on your local filesystem.

@mospeed
Copy link
Author

mospeed commented Nov 3, 2016

thanks for all quick responses. You are right it seems like a local environment issue. Let me get all that in order first.

@mospeed mospeed closed this as completed Nov 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants