You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing the following issue when creating the alloy template database.
When starting up the database and web project using docker-compose up, after creating the tempdb's, I get the following error:
Could not open file /var/opt/mssql/host_data/alloy-docker/alloy-docker.ldf for file number 0. OS error: 2(The system cannot find the file specified.).
When removing the LOG ON part of the script, it continues as it should and creates the log file:
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$SA_PASSWORD" -C -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '${DB_NAME}') CREATE DATABASE ${DB_NAME} ON (NAME=${DB_NAME}_data, FILENAME='/var/opt/mssql/host_data/${DB_DIRECTORY}/${DB_NAME}.mdf') LOG ON (NAME=${DB_NAME}_log, FILENAME='/var/opt/mssql/host_data/${DB_DIRECTORY}/${DB_NAME}.ldf') FOR ATTACH;"
The .ldf file is not present in the App_Data folder only the .mdf file.
The text was updated successfully, but these errors were encountered:
MicahBredenhorst
changed the title
create-db.sh Could not open ldf file, halts alloy sample database creation.
create-db.sh Could not open .ldf file, halts alloy sample database creation.
Oct 30, 2024
A workaround that I found was that if I run the "dotnet run" first on a windows 10/11, it will generate the .ldf files next to the .mdf. Note that the ldf files have a suffix of "_log.ldf" and create-db.sh script will fail with error
Unable to open the physical file "/var/opt/mssql/host_data/<project name>/<project name>.ldf".
create-db.sh needs to have it update to pass this error.
System:
I am experiencing the following issue when creating the alloy template database.
When starting up the database and web project using
docker-compose up
, after creating the tempdb's, I get the following error:Could not open file /var/opt/mssql/host_data/alloy-docker/alloy-docker.ldf for file number 0. OS error: 2(The system cannot find the file specified.).
When removing the
LOG ON
part of the script, it continues as it should and creates the log file:/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$SA_PASSWORD" -C -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '${DB_NAME}') CREATE DATABASE ${DB_NAME} ON (NAME=${DB_NAME}_data, FILENAME='/var/opt/mssql/host_data/${DB_DIRECTORY}/${DB_NAME}.mdf') LOG ON (NAME=${DB_NAME}_log, FILENAME='/var/opt/mssql/host_data/${DB_DIRECTORY}/${DB_NAME}.ldf') FOR ATTACH;"
The
.ldf
file is not present in the App_Data folder only the.mdf
file.The text was updated successfully, but these errors were encountered: