Problem/Motivation
From discussion on #3178061: Conflict resolution for multiple Domain Aliases on same environment it would seem the root cause could be that the domain alias is not being derived correctly when it is provided via a drush command.
Steps to reproduce
1. Install domain_alias module
2. Create a domain "www.example.com"
3. Setup these aliases on that domain for the DEV environment in this order:
- dev.example.com
- exampledev.prod.acquia-sites.com
4. Setup these aliases on that domain for the STAGE environment in this order:
- exampletest.prod.acquia-sites.com
- stg.example.com
5. Deploy these changes to DEV and STAGE
6. SSH into DEV and notice the Domain loads to "dev.example.com"
drush php:cli -l https://dev.example.com
>>> echo \Drupal::entityTypeManager()->getStorage("domain")->load("example_com")->get("hostname") . "\n";
dev.example.com
7. SSH into STAGE and notice the Domain loads to "exampletest.prod.acquia-sites.com"
drush php:cli -l https://stg.example.com
>>> echo \Drupal::entityTypeManager()->getStorage("domain")->load("example_com")->get("hostname") . "\n";
exampletest.prod.acquia-sites.com"
The human doing this might expect "stg.example.com" to load because that is the domain passed via the CLI. However, it's not!
Proposed resolution
TBD
Remaining tasks
TBD
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Issue fork domain-3179682
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
Comment #2
maacl commentedDrush listens to a environment variable
DRUSH_OPTIONS_URIto allow setting the current host in CLI commands. Did you try that?drush user:loginis another example, where this may needed, regardless of the usage of domain access.Comment #3
agentrickardJoe --
Did the fixes in the other issue solve this problem?
Comment #4
mably commentedComment #5
mably commentedUnless new, valuable information is provided, this issue will be closed in 3 months.
Comment #6
mably commentedComment #7
mably commentedComment #8
mably commentedComment #9
mably commentedThe solution here is to create two new environments, it could be DEV-ACQUIA and STAGE-ACQUIA for example.
Comment #11
mably commentedComment #13
mably commented