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

Sql docker container exists everytime when running in the XP mode #154

Closed
VipraB opened this issue Dec 3, 2019 · 8 comments
Closed

Sql docker container exists everytime when running in the XP mode #154

VipraB opened this issue Dec 3, 2019 · 8 comments

Comments

@VipraB
Copy link

VipraB commented Dec 3, 2019

Solr is not able to connect to the SQL docker container .The Processing enginer when trying to connect to the SQL it is not able to make the connection and gives the below error.

docker logs --details 8ff951b4c3d3

Existing Sitecore databases found in 'C:\data\'...

Attaching 'sc_Core'...

Attaching 'sc_Exm.master'...

Attaching 'sc_Experienceforms'...

Attaching 'sc_MarketingAutomationAzure'...

Attaching 'sc_Marketingautomation'...

Attaching 'sc_Master'...

Attaching 'sc_Messaging'...

Attaching 'sc_Processing.Engine.Storage'...

Attaching 'sc_Processing.Engine.Tasks'...

Attaching 'sc_Processing.pools'...

Attaching 'sc_Processing.tasks'...

Attaching 'sc_Referencedata'...

Attaching 'sc_Reporting'...

Attaching 'sc_Sessions'...

Attaching 'sc_Web'...

Attaching 'sc_Xdb.Collection.Shard0'...

Attaching 'sc_Xdb.Collection.Shard1'...

Attaching 'sc_Xdb.Collection.ShardMapManager'...

Preparing Sitecore databases...

Invoke-Sqlcmd : Invalid object name
'Sitecore.Xdb.Collection.ShardMapManager.__ShardManagement.ShardsGlobal'.
At C:\Boot.ps1:44 char:1

  • Invoke-Sqlcmd -Query ("UPDATE [Sitecore.Xdb.Collection.ShardMapManage ...
  •   + CategoryInfo          : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerS
     hellSqlExecutionException
      + FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShe
     ll.GetScriptCommand
    
@pbering
Copy link
Contributor

pbering commented Dec 3, 2019

Keyword here is "Existing Sitecore databases found in 'C:\data'..." ... you properly have run XM or another compose before so whenever you are switching you need to clean the .\data folder, you can use the .\Clean-Data.ps1 script for that. Else fresh databases / indexes for the given topology will not be seeded.

@VipraB
Copy link
Author

VipraB commented Dec 3, 2019

Thanks that worked.

But I need to run solr and sitecore as on secure port by generating the ssl certificates.
Can you help me understand where we can do the required changes to achieve this.

@pbering
Copy link
Contributor

pbering commented Dec 3, 2019

Good :)

I can't point you to an example but what we are doing (sometime locally and always in upstream environments) is to put a proxy in front that does SSL termination.

Looks like this:

                           / -> HTTP -> solr
HTTPS -> nginx or traefik ----> HTTP -> cm
                           \ -> HTTP -> cd

The point is that you only manage certificates 1 place instead of in all applications.

BTW solr should not normally be exposed on to the internet :)

@Antonytm
Copy link

Antonytm commented Dec 4, 2019

@pbering Looks like not only me faced with this issue during starting to work with Sitecore images.

May be it make sense to change volume mappings for different configurations to avoid overlapping?

e.g. for xm:
.\data-xm\sql:C:\Data
.\data-xm\solr:C:\Data
for xp:
.\data-xp\sql:C:\Data
.\data-xp\solr:C:\Data

What do you think?

@VipraB
Copy link
Author

VipraB commented Dec 4, 2019

Good :)

I can't point you to an example but what we are doing (sometime locally and always in upstream environments) is to put a proxy in front that does SSL termination.

Looks like this:

                           / -> HTTP -> solr
HTTPS -> nginx or traefik ----> HTTP -> cm
                           \ -> HTTP -> cd

The point is that you only manage certificates 1 place instead of in all applications.

BTW solr should not normally be exposed on to the internet :)

I am not trying to expose it to the internet but just to run in a secure environement .
So instead of putting the proxy is there any available batch script which can be used as a part of the Dockerfile to create and import the certificates within the docker image this is just for solr for now

@pbering
Copy link
Contributor

pbering commented Dec 5, 2019

@VipraB I do not know if any such scripts exists in the community.

@pbering
Copy link
Contributor

pbering commented Dec 5, 2019

@Antonytm I don't think that is a good idea since the purpose of /tests/ is mainly for those contributing so they easy validate images. It's also used by the community as a starting point and should be copied and modified as needed else where.

We haven't really started to use https://github.com/Sitecore/docker-demo yet but it seems like a better place for what you are asking for.

@michaellwest
Copy link
Contributor

Seems like this is not an issue. Perhaps document that a cleanup is required when switching and then close the issue.

@pbering pbering mentioned this issue Dec 18, 2019
bplasmeijer added a commit that referenced this issue Dec 18, 2019
kkum pushed a commit to kkum/docker-images that referenced this issue Mar 4, 2020
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

4 participants