Problem/Motivation

@chike reported in slack https://drupal.slack.com/archives/C7QJNEY3E/p1669230846802479

on shared hosting there are a bunch of symlinks. Such as

./.cpanel/ea-php-cli/.ea-php-cli.cache
./.cpanel/ea-php-cli/composer-sal/.ea-php-cli.cache
./.cpanel/ea-php-cli/drush/.ea-php-cli.cache
./.cpanel/ea-php-cli/drush/vendor/drush/drush/.ea-php-cli.cache
./.cpanel/ea-php-cli/public_html/.ea-php-cli.cache
./.cpanel/ea-php-cli/vendor/bin/.ea-php-cli.cache
./.cpanel/ea-php-cli/vendor/drush/drush/.ea-php-cli.cache

Steps to reproduce

Proposed resolution

We could add a `CollectIgnoredPathsEvent` subscriber that reads a config for list of paths to exclude.

This would make it much easier for situations like that assuming `./.cpanel` is not needed for the update.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#47 composerjson.txt5.92 KBchike
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tedbow created an issue. See original summary.

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs issue summary update

There's not enough detail in the issue summary. What are the paths in the issue summary relative to?

wim leers’s picture

Title: Add the ability to exclude paths to be staged in settings.php » Hosting environment may add additional files (including symlinks) to the project, which breaks AU
Priority: Normal » Major
Related issues: +#3319507: Add symlink support to Composer Stager 2.0, require that version, and simplify UX & tests accordingly, +#3319679: Assert known preconditions for test runs and fail early if unmet

Possibly naïve questions:

  1. Why don't we exclude all dotfiles automatically?
  2. If these are indeed symlinks (related: #3319507: Add symlink support to Composer Stager 2.0, require that version, and simplify UX & tests accordingly), they clearly are not part of the composer-installed packages. So … why are we not automatically ignoring all files that aren't part of a package, no matter whether they're a symlink or not? We could do that using composer status -v (see #3319679: Assert known preconditions for test runs and fail early if unmet).
chike’s picture

Let me explain.

I am using Greengeeks shared hosting. Greengeeks, like most host companies use cPanel to manage the host plans. I installed 'automatic_updates' and got like 3 error messages which I fixed but got stuck with the one about symlinks.

From the help module I got some info how to fix the symlinks issue which I followed the steps,

I ran composer require drupal/core-vendor-hardening

I added "composer-exit-on-patch-failure": true to composer.json

I also added

  "drupal-core-vendor-hardening": {
    "drush/drush": ["docs"],
    "grasmash/yaml-expander": ["scenarios"]
  }

to composer.json

Symlinks coming from 'drush/drush' and 'grasmash/yaml-expander' were solved but many more symlinks remained. When I checked I found the following list,

./.cpanel/ea-php-cli/.ea-php-cli.cache
./.cpanel/ea-php-cli/drush/.ea-php-cli.cache
./.cpanel/ea-php-cli/drush/vendor/drush/drush/.ea-php-cli.cache
./.cpanel/ea-php-cli/public_html/.ea-php-cli.cache
./.cpanel/ea-php-cli/vendor/bin/.ea-php-cli.cache
./.cpanel/ea-php-cli/vendor/drush/drush/.ea-php-cli.cache
./.cpanel/ea-php-cli/composer/.ea-php-cli.cache
./www
./access-logs
./.cphorde/meta/latest
./etc/mywebsite.com/info.rcube.db.latest
./mail/.info@mywebsite_com
./mail/.sales@mywebsite_com
./vendor/grasmash/yaml-expander/scenarios/symfony2/src
./vendor/grasmash/yaml-expander/scenarios/symfony2/tests
./vendor/grasmash/yaml-expander/scenarios/symfony4/src
./vendor/grasmash/yaml-expander/scenarios/symfony4/tests
./vendor/drush/drush/docs/drush_logo-black.png
./vendor/drush/drush/docs/misc/icon_PhpStorm.png
./vendor/drush/drush/docs/img/favicon.ico
./vendor/drush/drush/docs/contribute/CONTRIBUTING.md
./.cagefs/opt/alt/php81/link/conf
./.cagefs/opt/alt/php74/link/conf
./.cagefs/opt/alt/php52/link/conf
./.cagefs/opt/alt/php80/link/conf
./.cagefs/opt/alt/php55/link/conf
./.cagefs/opt/alt/php56/link/conf
./.cagefs/opt/alt/php54/link/conf
./.cagefs/opt/alt/php71/link/conf
./.cagefs/opt/alt/php70/link/conf
./.cagefs/opt/alt/php73/link/conf
./.cagefs/opt/alt/php44/link/conf
./.cagefs/opt/alt/php51/link/conf
./.cagefs/opt/alt/php72/link/conf
./.cagefs/opt/alt/php53/link/conf
./.cagefs/tmp/mysql.sock
./.cagefs/tmp/.s.PGSQL.5432

The folder structure of the site is,

| -cPanel-root
|   | -.cphorde/
|   | -.cpanel/
|   | -.cagefs/
|   | -www@
|   | -access-logs@
|   | -etc/
|   | -mail/
|   | -vendor/
|   | -composer.json
|   | -composer.lock
|   | -public_html/
|   |   | -core/

As shown, 'vendor' is on root and Drupal lives inside 'public_html'.

And there are a bunch of other folders on the root added by the host provider.

I had Drush 8 on the site which I installed earlier outside vendor folder but afterwards I removed it and re-installed Drush with 'composer require drush/drush'.

wim leers’s picture

Title: Hosting environment may add additional files (including symlinks) to the project, which breaks AU » Hosting environment (e.g. cPanel) may add additional files (including symlinks) to the project, which breaks AU
Assigned: Unassigned » tedbow
Priority: Major » Critical
Status: Postponed (maintainer needs more info) » Active
Issue tags: +core-mvp, +sprint
Related issues: +#3252299: Reliably support cweagans/composer-patches in Package Manager & Automatic Updates: validate stage

Thanks for the detailed additions, @chike, very much appreciated!

I think the most pragmatic way forward here is for one the Automatic Updates maintainers to get a one-month account with Green Geeks so we can observe and debug ourselves. Curious to hear what @tedbow thinks :)

In any case, I think this is critical: you're absolutely right that cPanel is very widely adopted. We should ensure that Automatic Updates works at least in those prior to getting into Drupal core as alpha experimental.

Automatic Updates may very well work on our development environments and pass automated tests, but that doesn't say much about the real world. This is a great example of that. Another is #3252299: Reliably support cweagans/composer-patches in Package Manager & Automatic Updates: validate stage, which @chike also encountered here. That issue is in the D10 alpha experimental roadmap. I believe this one should be too.

tedbow’s picture

Assigned: tedbow » wim leers

@Wim Leers re #3

So … why are we not automatically ignoring all files that aren't part of a package, no matter whether they're a symlink or not?

Unfortunately even though something is not in the install path of a package does not mean it is not managed by Composer. For instance our drupal/core-composer-scaffold plugin puts index.php and other files in their places and when a core update happens these files might be updated. But if we looked for the path of these under any of the install_path's of the packages that Composer they would not be present. Of course we ship with drupal/core-composer-scaffold so we could special case these files.

The problem is if we special case these files then we implicitly declaring that no other composer plugin can act like drupal/core-composer-scaffold and manage files outside it's install_path because we would not know about the files it manages.

So by default package_manager has been including everything inside the Composer project expect things that explicitly excluded. We exclude paths we know should excluded like the Sqlite db file or the files folder, see the classes under package_manager/src/PathExcluder. Basically we did this because we determined there is no 100% sure way of knowing what is managed by composer. If we accidentally exclude files that are managed by composer these files will not get updated if a new version of package updates these. Since we don't know the purpose of the files we might miss it is probably best to assume they are critical.

Of course this does lead to problem in this issue.

I think there are few way to solve this

  1. Instead of exclude certain folders we switch only including folders that are packages. This would mean we would have special drupal specific paths, such as index.php and site/default because aren't in package path but are managed by composer. We would also have to special case either the whole vendor directory or know files in there because these files are not install paths but are managed by composer.

    This would also mean we would miss any other file that are managed by composer in the same way the files managed by drupal/core-composer-scaffold. Of course we could make an API for packages to let us know what files they manage outside of their install_path but that kind of defeats the purpose of using Composer because it allows us to use packages that are not drupal aware.

  2. In the case where the project root is not the same as the web/docroot folder we only include vendor and web/docroot and leave the other exclusion logic as is. We would not have to special case drupal/core-composer-scaffold because all it's files are under web/docroot. Then any other Composer plugin that managed files outside of install_path would be ok if they only managed files under the web root and vendor

    This would probably solve the current use case but we don't 100% know there is not a Composer package being used that would manage files somewhere outside of the these folders. Also even if there is not such a package now we don't know that one might installed later and there would no way. of knowing when such as package is installed.

wim leers’s picture

Assigned: wim leers » Unassigned

Can I summarize #6 as It's more complicated because of https://getcomposer.org/doc/articles/plugins.md?

The problem is if we special case these files then we implicitly declaring that no other composer plugin can act like drupal/core-composer-scaffold and manage files outside it's install_path because we would not know about the files it manages.

We clearly cannot support arbitrary composer plugins, because we cannot know what their logic does.

But I don't see why we can not special case extra.drupal-scaffold.file-mapping, and add explicit support for it? Similarly, supporting composer/installers seems reasonable. (Even if we restrict it to only the drupal-* installers.)

But any other composer-plugin we would not support. Which to me opens a question I've had in the back of my head for a while: how do we know that certain composer plugins will not break AU? For example, #3252299: Reliably support cweagans/composer-patches in Package Manager & Automatic Updates: validate stage exists to deal with cweagans/composer-patches specifically, but what about other composer plugins?

AFAICT what we really need is a list of "known to be compatible" of composer plugins. Most will not need special attention, but some might. Of the 3 that Drupal core ships with, drupal/core-composer-scaffold needs special attention. cweagans/composer-patches clearly needs special attention, and we have no choice but to support. composer/package-versions-deprecated does not. Great, now we have 5 "known to be compatible" composer plugins. But then there's others that we may not need to bother with supporting, for example phpstan/extension-installer.

Once we have this, we could inform the user that "oh, sorry, you're using a composer plugin that we don't know if it breaks Automatic Updates/Package Manager, so we'd rather be safe than sorry: you won't be able to use AU/PM. Create a feature request to add support for it."

Isn't that the only way we can be truly confident about AU/PM working reliably?

I think there are few way to solve this

Consider the above my addition to your list 🤓

Not assigning to @tedbow to also get feedback from @TravisCarden.

chike’s picture

This being an issue with the Package Manager also affects Project Browser. I enabled Allow installing via UI (experimental) for Project Browser and visiting /admin/modules/browse flashed the error message,

Unable to download modules via the UI

The active directory at "/home/project-root" contains symlinks, which is not supported. The first one is "/home/project-root/.cagefs/opt/alt/php44/link/conf". See the help page for information on how to resolve the problem.

And the Add and Install button wouldn't show up.

wim leers’s picture

Thanks for the report, @chike! Unfortunately I can't prioritize this higher than Critical 😅 But I 100% agree this is important to resolve!

chike’s picture

Since this also affects Project Browser, is there need to reference this issue over there?

tedbow’s picture

@Wim Leers re #7.

Yeah I think that would be great if we can just not support project that have unknown composer plugins. I guess I was unsure how common have other plugins would be. I was assuming it would be pretty common but perhaps I am wrong. Or maybe it won't be common for simpler sites

If I search for "composer-plugin-api" in composer.json files of vendor for my drupal clone I only see five. If I then composer require drush/drush which adds more dependencies and do the same search I don't get any new results.

If did only support know plugins maybe we should have a way for sites to set an allow-list of plugins in settings.php that way if people want to write their own plugins or use certain ones they could do that. Because a lot of plugins are not going manage files outside the package directory itself. For instance our own https://github.com/php-tuf/composer-integration would not affect any such files

wim leers’s picture

I think 95% of sites will use the same dozen or so composer plugins.

So an approach where

  1. drupal/package_manager has an embedded list of "known safe/compatible composer plugins" and
  2. still allowing developers to extend it in their settings.php (at their own risk) to not have to wait for additional composer plugins to be added to/ship with the embedded list in point 1 seems reasonable 👍
tedbow’s picture

Issue tags: +Needs follow-up

Needs 2 potential follow-ups

  1. Change Package manager to only support with know composer plugins, with a possible way to override this in settings.php
  2. Have package by default omit exclude paths in the base directories
wim leers’s picture

tedbow’s picture

Issue tags: -Needs follow-up
wim leers’s picture

Title: Hosting environment (e.g. cPanel) may add additional files (including symlinks) to the project, which breaks AU » [PP-5] Hosting environment (e.g. cPanel) may add additional files (including symlinks) to the project, which breaks AU
Status: Active » Postponed
wim leers’s picture

Title: [PP-5] Hosting environment (e.g. cPanel) may add additional files (including symlinks) to the project, which breaks AU » [PP-1] Hosting environment (e.g. cPanel) may add additional files (including symlinks) to the project, which breaks AU
wim leers’s picture

Title: [PP-1] Hosting environment (e.g. cPanel) may add additional files (including symlinks) to the project, which breaks AU » Hosting environment (e.g. cPanel) may add additional files (including symlinks) to the project, which breaks AU
Assigned: Unassigned » tedbow
Status: Postponed » Active

#3331310: Exclude unknown paths in project base: only allow vendor + web root + whatever drupal/core-composer-scaffold allows landed, which means this should be fixed now!

As soon as @tedbow has tagged a new 2.7 release, we should ask @chike to update and report back 😊

chike’s picture

I am waiting to do that.

I have been following the work. It's amazing.

wim leers’s picture

Cool to know you've been following along! 😊

chike’s picture

Yes I have been following along and admiring how the work was going. I wish I knew enough programming to contribute, but maybe someday....maybe.

tedbow’s picture

Version: 8.x-2.x-dev » 3.0.x-dev
tedbow’s picture

Version: 3.0.x-dev » 8.x-2.x-dev

@chike the 8.x-2.7 release is out if you want to try it

wim leers’s picture

Assigned: tedbow » Unassigned
Status: Active » Postponed (maintainer needs more info)

Per #24 — over to you, @chike! 😊

chike’s picture

Updated to 2.7 and site throws WSOD with message,

TypeError: array_map(): Argument #2 ($array) must be of type array, null given in array_map() (line 130 of /home/project-root/public_html/modules/contrib/automatic_updates/package_manager/src/Validator/ComposerPluginsValidator.php)

tedbow’s picture

@chike thanks for testing

Sorry about that I think that is our fault. I created #3341927: No update hook for additional_trusted_composer_plugins setting which I think is the problem

I credited you on that issue

wim leers’s picture

#26: you did not run yoursite.com/update.php — i.e. you forgot to apply database updates 😅

chike’s picture

I forgot to update the database, that solved the issue. I am sorry that caused you unnecessary trouble.

But the symlinks are still there.

It's a long list of them,

user@xxxxxx [~]# find . -type l
./.cpanel/ea-php-cli/.ea-php-cli.cache
./.cpanel/ea-php-cli/composer-sal/.ea-php-cli.cache
./.cpanel/ea-php-cli/drush/.ea-php-cli.cache
./.cpanel/ea-php-cli/drush/vendor/drush/drush/.ea-php-cli.cache
./.cpanel/ea-php-cli/public_html/.ea-php-cli.cache
./.cpanel/ea-php-cli/vendor/bin/.ea-php-cli.cache
./.cpanel/ea-php-cli/vendor/drush/drush/.ea-php-cli.cache
./.cpanel/ea-php-cli/composer/.ea-php-cli.cache
./www
./access-logs
./.cphorde/meta/latest
./etc/mywebsite.com/info.rcube.db.latest
./mail/.info@mywebsite_com
./mail/.marketing@mywebsite_com
./vendor/grasmash/yaml-expander/scenarios/symfony2/src
./vendor/grasmash/yaml-expander/scenarios/symfony2/tests
./vendor/grasmash/yaml-expander/scenarios/symfony4/src
./vendor/grasmash/yaml-expander/scenarios/symfony4/tests
./vendor/drush/drush/docs/drush_logo-black.png
./vendor/drush/drush/docs/misc/icon_PhpStorm.png
./vendor/drush/drush/docs/img/favicon.ico
./vendor/drush/drush/docs/contribute/CONTRIBUTING.md
./.cagefs/opt/alt/php81/link/conf
./.cagefs/opt/alt/php74/link/conf
./.cagefs/opt/alt/php52/link/conf
./.cagefs/opt/alt/php80/link/conf
./.cagefs/opt/alt/php55/link/conf
./.cagefs/opt/alt/php56/link/conf
./.cagefs/opt/alt/php82/link/conf
./.cagefs/opt/alt/php54/link/conf
./.cagefs/opt/alt/php71/link/conf
./.cagefs/opt/alt/php70/link/conf
./.cagefs/opt/alt/php73/link/conf
./.cagefs/opt/alt/php44/link/conf
./.cagefs/opt/alt/php51/link/conf
./.cagefs/opt/alt/php72/link/conf
./.cagefs/opt/alt/php53/link/conf
./.cagefs/tmp/mysql.sock
./.cagefs/tmp/.s.PGSQL.5432
wim leers’s picture

The symlinks won't disappear. Automatic Updates/Package Manager didn't put them there!

What matters, is that these no longer prevent you from using Automatic Updates. If you visit the status report, do you still get error messages for Automatic Updates/Package Manager?

tedbow’s picture

Besides #30 if you goto the update form at `/admin/reports/updates/update` is the update button available? Or course if you are the on the latest patch version of you drupal core minor then there would be no version to update to.

If the Update button is not there does it show you any errors?

chike’s picture

For #30 update readiness checks is still failing,

Update readiness checks
Your site does not pass some readiness checks for automatic updates. It cannot be automatically updated until further action is performed.
The active directory at "/home/project-root" contains symlinks, which is not supported. The first one is "/home/project-root/.cagefs/opt/alt/php44/link/conf". See the help page for information on how to resolve the problem.

For #31 the update button is not visible and I have pending core updates. I get the message,

Your site does not pass some readiness checks for automatic updates. It cannot be automatically updated until further action is performed.
The active directory at "/home/project-root" contains symlinks, which is not supported. The first one is "/home/project-root/.cagefs/opt/alt/php44/link/conf". See the help page for information on how to resolve the problem.
wim leers’s picture

Assigned: Unassigned » kunal.sachdev
Status: Postponed (maintainer needs more info) » Active
Issue tags: +Needs tests

Hm … 🤔

This suggests that #3331310: Exclude unknown paths in project base: only allow vendor + web root + whatever drupal/core-composer-scaffold allows is not actually finding all the files in the project root … I think we should create a test that simulates @chike's environment, which roughly looks like this:

home/
  project-root/
    .cagefs/
      symlink-here
    vendor/
      …
    www/
      …

UnknownPathExcluder should add /home/project-root/.cagefs/symlink-here to the collection of ignored paths!

Assigning to @kunal.sachdev since he did 99% of the work on #3331310: Exclude unknown paths in project base: only allow vendor + web root + whatever drupal/core-composer-scaffold allows, so he'll be the most proficient at writing this test 😊

chike’s picture

If you want to test on a shared hosting server you can purchase a shared hosting plan from Greengeeks (which I am using) Once activated you will find that your web-root is a folder called public_html (this is what servers managed with cPanel software always have as web-root by default) so you should make a modified install to place Drupal inside public_html as against the default web folder. The folder containing public_html will then be your project-root. The /home is part of the absolute path for the host account but never accessible.

kunal.sachdev made their first commit to this issue’s fork.

kunal.sachdev’s picture

Assigned: kunal.sachdev » wim leers
Status: Active » Needs review
wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

@kunal.sachdev Next time, please push up a test-only commit first, so we can see it fail. Then we can see it pass after you push the fix. That makes it crystal clear that the test catches the problem and the fix fixes it 🤓

I did that locally: I reverted the fix, kept only the test additions, and it indeed fails:

PHPUnit 9.5.26 by Sebastian Bergmann and contributors.

Testing /Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Kernel/PathExcluder
...F...F                                                            8 / 8 (100%)

Time: 00:11.159, Memory: 10.00 MB

There were 2 failures:

1) Drupal\Tests\package_manager\Kernel\PathExcluder\UnknownPathExcluderTest::testUnknownPath with data set "unknown hidden file where web and project root different" (true, null, array('.unknown_file'))
Failed asserting that file "/private/tmp/package_manager_testing_roottest10647682/stage/3ou-WDmPdCroz5R55CbNm_IAtJGxK_GVv-8bR87nElU/.unknown_file" does not exist.

/Users/wim.leers/core/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
/Users/wim.leers/core/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
/Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Kernel/PathExcluder/UnknownPathExcluderTest.php:164
/Users/wim.leers/core/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

2) Drupal\Tests\package_manager\Kernel\PathExcluder\UnknownPathExcluderTest::testUnknownPath with data set "unknown hidden directory where web and project root different" (true, '.unknown_dir', array('.unknown_dir/unknown_dir.README.md', '.unknown_dir/unknown_file.txt'))
Failed asserting that file "/private/tmp/package_manager_testing_roottest57665865/stage/0ODADlWYhJAdEqp1g24Z82pPyhUfvCaKcDLkQiRMXso/.unknown_dir/unknown_dir.README.md" does not exist.

/Users/wim.leers/core/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
/Users/wim.leers/core/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
/Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Kernel/PathExcluder/UnknownPathExcluderTest.php:164
/Users/wim.leers/core/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

FAILURES!
Tests: 8, Assertions: 47, Failures: 2.
Process finished with exit code 1
chike’s picture

I applied MR 709 patch, cleared caches, reran readiness checks and yet same thing, site does not pass.

phenaproxima’s picture

Status: Reviewed & tested by the community » Needs work

Back to the ol' drawing board, based on #39. 😭 Keep fighting the good fight! 💪

tedbow’s picture

Issue tags: +Needs manual testing

@kunal.sachdev I would suggest making local composer project and adding some symlinks like is describing in this issue. It would be good to see if you saw the same thing outside of tests.

kunal.sachdev’s picture

I made a local composer project with Drupal core 10.0.0 and created a symlink. I updated my site to 10.0.3 successfully using automatic updates.

chike’s picture

Could you try with web-root named differently from web.

wim leers’s picture

Assigned: Unassigned » kunal.sachdev

#42: Can you show exactly what the directory structure was that you tested with? That's easy to achieve if you use tree (brew install tree):

tree -a -L 2 -F -n --filesfirst

should give you something like:

$ tree -a -L 2 -F -n --filesfirst
./
├── .DS_Store
├── .csslintrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.json
├── .gitattributes
<snip>
├── .git/
<snip>
├── .idea/
<snip>
├── composer/
<snip>
├── core/
│   ├── .cspell.json
<snip>

Use that to make it easy for us to understand what exactly you're testing :)

That, plus find . -type l of course.

kunal.sachdev’s picture

 $ tree -a -L 2 -F -n --filesfirst
./
├── .editorconfig
├── .gitattributes
├── composer.json
├── composer.lock
├── symlink -> composer.json
├── vendor/
│   ├── autoload.php
│   ├── asm89/
│   ├── bin/
│   ├── composer/
│   ├── doctrine/
│   ├── drupal/
│   ├── egulias/
│   ├── guzzlehttp/
│   ├── justinrainbow/
│   ├── masterminds/
│   ├── pear/
│   ├── php-tuf/
│   ├── psr/
│   ├── ralouphie/
│   ├── react/
│   ├── seld/
│   ├── symfony/
│   └── twig/
└── web/
    ├── .csslintrc
    ├── .eslintignore
    ├── .eslintrc.json
    ├── .ht.router.php
    ├── .htaccess
    ├── INSTALL.txt
    ├── README.md
    ├── autoload.php
    ├── example.gitignore
    ├── index.php
    ├── robots.txt
    ├── update.php
    ├── web.config
    ├── core/
    ├── modules/
    ├── profiles/
    ├── sites/
    └── themes/

25 directories, 19 files

and

$ find . -type l                 
./symlink
tedbow’s picture

@chike can you upload the composer.json file at the root of your project? Thanks

chike’s picture

StatusFileSize
new5.92 KB

Here.

kunal.sachdev’s picture

So I tried it again with the following directory structure :

./
├── .editorconfig
├── .gitattributes
├── composer.json
├── composer.lock
├── .cagefs/
│   └── opt/
├── .idea/
│   ├── .gitignore
│   ├── modules.xml
│   ├── my-test-project.iml
│   └── workspace.xml
├── public_html/
│   ├── .csslintrc
│   ├── .eslintignore
│   ├── .eslintrc.json
│   ├── .ht.router.php
│   ├── .htaccess
│   ├── INSTALL.txt
│   ├── README.md
│   ├── autoload.php
│   ├── example.gitignore
│   ├── index.php
│   ├── robots.txt
│   ├── update.php
│   ├── web.config
│   ├── core/
│   ├── modules/
│   ├── profiles/
│   ├── sites/
│   └── themes/
└── vendor/
    ├── autoload.php
    ├── asm89/
    ├── bin/
    ├── composer/
    ├── doctrine/
    ├── drupal/
    ├── egulias/
    ├── guzzlehttp/
    ├── justinrainbow/
    ├── masterminds/
    ├── pear/
    ├── php-tuf/
    ├── psr/
    ├── ralouphie/
    ├── react/
    ├── seld/
    ├── symfony/
    └── twig/

28 directories, 22 files

and

$ find . -type l                                  
./.cagefs/opt/alt/php44/link/conf

and
I updated my site to 10.0.3 successfully using automatic updates.

wim leers’s picture

Assigned: kunal.sachdev » Unassigned
Status: Needs work » Postponed (maintainer needs more info)

@kunal.sachdev's manual testing in #48 suggests that it should work fine for @chike too … 🤔

@chike In #39 you said you had applied the patch for this MR. Are you sure it was truly applied? A small mistake is easy to make :) How did you apply it exactly? Using cweagans/composer-patches or some other mechanism?

chike’s picture

In #47 I posted my composer.json so you would see how I added the MR patch.

I tried AU in another D9 site and got this message:

Your site does not pass some readiness checks for automatic updates. It cannot be automatically updated until further action is performed.
The active directory at "/home/project-root" contains symlinks, which is not supported. The first one is "/home/project-root/vendor/drush/drush/docs/contribute/CONTRIBUTING.md". See the help page for information on how to resolve the problem.
An unsupported Composer plugin was detected.
oomphinc/composer-installers-extender

On this second site I am using Asset Packagist to install libraries and wanted the libraries installed in libraries folder and not vendor so I added https://github.com/oomphinc/composer-installers-extender to be able to do that. This plugin should be popular so good for AU to exclude it.

Then I tried on a new D10 site I installed on a different shared hosting company and on this site I got no mention of symlinks, only one blocker as in the message I got;

Your site does not pass some readiness checks for automatic updates. It cannot be automatically updated until further action is performed.
Unable to collect ignored paths, therefore can't perform status checks.
RecursiveDirectoryIterator::__construct(/home/project-root/.nc_plugin): Failed to open directory: Permission denied

I listed the symlinks on the site and got:

[superuser@server180 ~]$ find . -type l
./mail/.info@website1_com
./mail/.chike@website2_com
./mail/.admin@website1_com
./demo1/vendor/grasmash/yaml-expander/scenarios/symfony2/tests
./demo1/vendor/grasmash/yaml-expander/scenarios/symfony2/src
./demo1/vendor/grasmash/yaml-expander/scenarios/symfony4/tests
./demo1/vendor/grasmash/yaml-expander/scenarios/symfony4/src
./demo1/vendor/bin/dcg
./demo1/vendor/bin/psysh
./demo1/vendor/bin/var-dump-server
./demo1/vendor/bin/release
./demo1/vendor/bin/robo
./demo1/vendor/bin/php-parse
./demo1/vendor/bin/drush
./demo1/vendor/consolidation/log/.scenarios.lock/symfony2/tests
./demo1/vendor/consolidation/log/.scenarios.lock/symfony2/src
./demo1/vendor/consolidation/log/.scenarios.lock/symfony4/tests
./demo1/vendor/consolidation/log/.scenarios.lock/symfony4/src
./demo1/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/tests
./demo1/vendor/consolidation/site-alias/.scenarios.lock/phpunit5/src
./demo1/vendor/drush/drush/docs/misc/icon_PhpStorm.png
./demo1/vendor/drush/drush/docs/img/favicon.ico
./demo1/vendor/drush/drush/docs/index.md
./demo1/vendor/drush/drush/docs/contribute/CONTRIBUTING.md
./demo1/vendor/drush/drush/docs/drush_logo-black.png
./.cagefs/opt/alt/php53/link/conf
./.cagefs/opt/alt/php70/link/conf
./.cagefs/opt/alt/php52/link/conf
./.cagefs/opt/alt/php72/link/conf
./.cagefs/opt/alt/php71/link/conf
./.cagefs/opt/alt/php74/link/conf
./.cagefs/opt/alt/php54/link/conf
./.cagefs/opt/alt/php56/link/conf
./.cagefs/opt/alt/php81/link/conf
./.cagefs/opt/alt/php55/link/conf
./.cagefs/opt/alt/php73/link/conf
./.cagefs/opt/alt/php80/link/conf
./.cagefs/tmp/mysql.sock
./.cagefs/tmp/.s.PGSQL.5432
./access-logs
./vendor/drush/drush/docs/misc/icon_PhpStorm.png
./vendor/drush/drush/docs/img/favicon.ico
./vendor/drush/drush/docs/contribute/CONTRIBUTING.md
./vendor/drush/drush/docs/drush_logo-black.png
find: `./.nc_plugin': Permission denied
./www

Note this line: find: `./.nc_plugin': Permission denied. From little Googling it's like .nc_plugin is troublesome. Here is info on it as on the website of the host company, Namecheap where I uploaded the D10 site, https://www.namecheap.com/support/knowledgebase/article.aspx/10294/29/ho...

So on two D9 sites I got symlinks blocking AU and on one D10 site it didn't mention symlinks

@kunal.sachdev could you make a test using D9?

wim leers’s picture

With #3319507: Add symlink support to Composer Stager 2.0, require that version, and simplify UX & tests accordingly committed, the 3.0.x branch should simply not complain about this at all!

phenaproxima’s picture

Version: 8.x-2.x-dev » 3.0.x-dev