0

Has anyone ever run into the error below when running a build for Sitecore 10.1? It used to work fine and now this error pops up. I'm adding SPE and SXA to MSSQL. Again, it just started breaking but worked in the past.

Here is the code in the dockerfile that generates the error now:

# Add SPE module
COPY --from=spe \module\db \spe_data
RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\spe_data; `
    Remove-Item -Path C:\spe_data -Recurse -Force;

Here is the error on docker-compose build:

Step 11/15 : RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\spe_data;     Remove-Item -Path C:\spe_data -Recurse -Force;
 ---> Running in bffa4ae2ed24
Start-Service : Cannot find any service with service name 'MSSQLSERVER'.
At C:\DeployDatabases.ps1:78 char:5
+     Start-Service MSSQLSERVER;

Thanks!

7
  • Since the MSSQLSERVICE service exists in the mssql Sitecore base images, it looks like step 11/15 in your Dockerfile is getting executed on the wrong base image. Can you share your entire Dockerfile? Commented Nov 8, 2021 at 3:54
  • Hi @AlessandroFaniuolo I'm not sure how the base image could have changed? I haven't modified the code and it has worked on several builds. Only recently did this error occur. I did update Docker Desktop to the next update, but I don't think that would cause this issue. If I strip out the module adds in the MS SQL build it does complete. However, when the container starts the log file says this: C:\StartInit.ps1 : Cannot bind argument to parameter 'SqlServer' because it is an empty string. At line:1 char:143 + ... urcesDirectory $env:RESOURCES_PATH -SqlServer $env:SQL_SERVER -SqlAd Commented Nov 8, 2021 at 16:37
  • One thing that could cause the wrong base image to be used is having the wrong order of the FROM commands in the Dockerfile (this is why I asked you to share your entire Dockerfile). Commented Nov 8, 2021 at 16:59
  • Understood. That is why I tried stripping out the modules. But again, the odd thing is that it all worked before and is straight from Sitecore. Here is the file now that allows the build, but the container fails with the message above. Thanks for looking! FROM ${BASE_IMAGE} SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] Commented Nov 8, 2021 at 17:09
  • The StartInit.ps1 script is the entrypoint script of the mssql-init image, not of the mssql image. Are you trying to build a custom mssql-init image or installing the modules in the mssql image? Commented Nov 8, 2021 at 17:28

1 Answer 1

1

From looking at the error shared in the comment above:

C:\StartInit.ps1 : Cannot bind argument to parameter 'SqlServer' because it is an empty string. At line:1 char:143 + ... urcesDirectory $env:RESOURCES_PATH -SqlServer $env:SQL_SERVER -SqlAd

It seems that the base image used as build argument is a mssql-init image and not a mssql image, because the StartInit.ps1 entrypoint is the entrypoint script of a mssql-init image. This explains why the build process fails when trying to start the SQL Server service, that of course doesn't exist in a mssql-init image.

1
  • Thank you! I was in the process of changing to 10.2 and left something behind....doh. Thanks for taking it into chat to really get a look at the issue. Commented Nov 8, 2021 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.