Open
Description
When setting the Alloy demo up
$ dotnet new epi-alloy-mvc --name alloy-docker --output ./alloy-docker --enable-docker
The template "Optimizely Alloy MVC" was created successfully.
$ cd alloy-docker
$ docker-compose up
I have an issue with the database creation. This may be a local issue with docker however on reviewing the logs I noticed CREATE DATABASE failed.
followed by Creating database completed
.
2023-02-22 11:38:02.26 spid51 CREATE FILE encountered operating system error 87(The parameter is incorrect.) while attempting to open or create the physical file '/var/opt/mssql/host_data/cms.mdf'.
Msg 5123, Level 16, State 1, Server 9b4d2b960188, Line 1
CREATE FILE encountered operating system error 87(The parameter is incorrect.) while attempting to open or create the physical file '/var/opt/mssql/host_data/cms.mdf'.
Msg 1802, Level 16, State 4, Server 9b4d2b960188, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Creating database completed
On reviewing the source code the status code is checked
content-templates/templates/Alloy.Mvc/Docker/create-db.sh
Lines 1 to 12 in 0c72f0e
However sqlcmd
requires -b
to return an error value https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-utility
Error Reporting Options
-b
Specifies that sqlcmd exits and returns a DOS ERRORLEVEL value when an error occurs. The value that is returned to the DOS ERRORLEVEL variable is 1 when the SQL Server error message has a severity level greater than 10; otherwise, the value returned is 0. If the -V option has been set in addition to -b, sqlcmd will not report an error if the severity level is lower than the values set using -V. Command prompt batch files can test the value of ERRORLEVEL and handle the error appropriately. sqlcmd does not report errors for severity level 10 (informational messages).
If the sqlcmd script contains an incorrect comment, syntax error, or is missing a scripting variable, ERRORLEVEL returned is 1.
The following files appear to be affected by this behaviour:
- templates/Alloy.Mvc/Docker/create-db.sh
- templates/Cms.Empty/Docker/create-db.sh
- templates/Commerce.Empty/Docker/create-db.sh
Metadata
Metadata
Assignees
Labels
No labels