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

SOLR routing seems to be randomly connecting to other projects #1895

Closed
andrewbelcher opened this issue Oct 23, 2019 · 8 comments
Closed

SOLR routing seems to be randomly connecting to other projects #1895

andrewbelcher opened this issue Oct 23, 2019 · 8 comments

Comments

@andrewbelcher
Copy link
Contributor

Describe the bug
It appears that f you have two projects running at the same time, the SOLR connection (using the instructions and example docker-compose.solr.yml at https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#apache-solr) will randomly switch between the two!

To Reproduce
In my case, we have two Drupal 8 projects with Search API connecting to SOLR:

  1. Create two Drupal 8 projects with Search API and a SOLR server.
  2. Start one of the projects and index the items (drush sapi-i for example).
  3. Start the second project and navigate to your admin page for your SOLR server (e.g. /admin/config/search/search-api/server/SERVER_ID)
  4. Refresh the page while looking at the Indexed count - it will vary between zero and however many items project 1 indexed.
  5. Cry in confusion :'(

Expected behavior
Each project only ever accesses it's own SOLR container.

Screenshots
If applicable, add screenshots to help explain your problem.

Version and configuration information (please complete the following information):

  • Host computer OS and Version: CentOS 7
  • Docker version information
Client: Docker Engine - Community
 Version:           19.03.2
 API version:       1.40
 Go version:        go1.12.8
 Git commit:        6a30dfc
 Built:             Thu Aug 29 05:28:55 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.2
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.8
  Git commit:       6a30dfc
  Built:            Thu Aug 29 05:27:34 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
  • ddev version information
DDEV-Local version	v1.11.1                        
commit            	v1.11.1                        
db                	drud/ddev-dbserver:v1.11.0-10.2
dba               	drud/phpmyadmin:v1.11.0        
ddev-ssh-agent    	drud/ddev-ssh-agent:v1.11.0    
docker            	19.03.2                        
docker-compose    	1.23.2                         
os                	linux                          
router            	drud/ddev-router:v1.11.0       
web               	drud/ddev-webserver:v1.11.0
  • config.yaml contents for the misbehaving project
APIVersion: v1.11.1
name: client
type: drupal8
docroot: web
php_version: "7.3"
webserver_type: apache-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames:
- www.client
- subdomain.client
additional_fqdns: []
mariadb_version: "10.2"
nfs_mount_enabled: false
provider: default
omit_containers: [dba, ddev-ssh-agent]
use_dns_when_possible: true
timezone: Europe/London
@rfay
Copy link
Member

rfay commented Oct 23, 2019

In your Drupal install, what hostname are you using to access the solr server?

@andrewbelcher
Copy link
Contributor Author

@rfay http://solr:8983/solr/#/dev in Drupal, but I've also found that I get inconsistent results when I access via the admin console using the http://project.ddev.site:8983 URL - though I have only seen that changing when I stop/start things, so perhaps that behaves consistently when it's up and running.

Here is GIF of the issue:
image

@andrewbelcher
Copy link
Contributor Author

D'oh, it converted the gif to a png :'(
image

@andrewbelcher
Copy link
Contributor Author

Ah - I can confirm that switching to using project.ddev.site in Drupal does make it consistent! I think the issue I had with the admin UI was when I had actually stopped the project I was accessing, it looks like it may have fallen through to the other one. However - that looks like a workable solution.

@rfay
Copy link
Member

rfay commented Oct 23, 2019

I think using project.ddev.site would work, and also using ddev-<project>-solr would work (direct access)

@andrewbelcher
Copy link
Contributor Author

@rfay thanks for the super quick response and guiding me to a solution!

Not sure I know docker enough to try and solve the issue with using solr has the hostname, but I can do a PR to update the documentation to recommend either <project>.ddev.site or ddev-<project>-solr if you'd like?

@rfay
Copy link
Member

rfay commented Oct 23, 2019

I'm thinking it's a bug in the docker compose suggestion... Will try.

@rfay
Copy link
Member

rfay commented Nov 5, 2019

BTW, this was fixed in #1897 - You really need the links stanza to make it work right. Has to be a docker bug, but true.

Related: #813 (links flag in normal docker-compose.yaml)

@rfay rfay closed this as completed Nov 5, 2019
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

2 participants