Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented May 28, 2021

Seems that running mssql on self-hosted runner makes mssql
container fail with empty volume. This PR is to check if
just providing the empty 'data' and not removing logs folder
causes the failure.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

Seems that running mssql on self-hosted runner makes mssql
container fail with empty volume. This PR is to check if
just providing the empty 'data' and not removing logs folder
causes the failure.
@potiuk potiuk requested a review from ashb as a code owner May 28, 2021 15:41
@potiuk
Copy link
Member Author

potiuk commented May 28, 2021

cc: @aneesh-joseph

@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label May 28, 2021
@potiuk
Copy link
Member Author

potiuk commented May 28, 2021

Did not help it seems . I will remove the volume completely and see how it works.

@potiuk
Copy link
Member Author

potiuk commented May 29, 2021

Not helping. Time to try to reproduce it in the runner itself:

Same error (from the artifacts):

SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
2021-05-28 18:29:45.17 Server      Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.

2021-05-28 18:29:45.28 Server      Did not find an existing master data file /var/opt/mssql/data/master.mdf, copying the missing default master and other system database files. If you have moved the database location, but not moved the database files, startup may fail. To repair: shutdown SQL Server, move the master database to configured location, and restart.

2021-05-28 18:29:45.29 Server      Setup step is copying system data file 'C:\templatedata\mastlog.ldf' to '/var/opt/mssql/data/mastlog.ldf'.

2021-05-28 18:29:45.29 Server      Setup step is copying system data file 'C:\templatedata\model.mdf' to '/var/opt/mssql/data/model.mdf'.

2021-05-28 18:29:45.31 Server      Setup step is copying system data file 'C:\templatedata\modellog.ldf' to '/var/opt/mssql/data/modellog.ldf'.

2021-05-28 18:29:45.32 Server      Setup step is copying system data file 'C:\templatedata\msdbdata.mdf' to '/var/opt/mssql/data/msdbdata.mdf'.

2021-05-28 18:29:45.34 Server      Setup step is copying system data file 'C:\templatedata\msdblog.ldf' to '/var/opt/mssql/data/msdblog.ldf'.

2021-05-28 18:29:45.35 Server      Setup step is FORCE copying system data file 'C:\templatedata\model_replicatedmaster.mdf' to '/var/opt/mssql/data/model_replicatedmaster.mdf'.

2021-05-28 18:29:45.36 Server      Setup step is FORCE copying system data file 'C:\templatedata\model_replicatedmaster.ldf' to '/var/opt/mssql/data/model_replicatedmaster.ldf'.

2021-05-28 18:29:45.37 Server      Setup step is FORCE copying system data file 'C:\templatedata\model_msdbdata.mdf' to '/var/opt/mssql/data/model_msdbdata.mdf'.

2021-05-28 18:29:45.39 Server      Setup step is FORCE copying system data file 'C:\templatedata\model_msdblog.ldf' to '/var/opt/mssql/data/model_msdblog.ldf'.

2021-05-28 18:29:45.48 Server      Microsoft SQL Server 2019 (RTM-CU10) (KB5001090) - 15.0.4123.1 (X64) 

	Mar 22 2021 18:10:24 

	Copyright (C) 2019 Microsoft Corporation

	Developer Edition (64-bit) on Linux (Ubuntu 20.04.2 LTS) <X64>

2021-05-28 18:29:45.49 Server      UTC adjustment: 0:00

2021-05-28 18:29:45.49 Server      (c) Microsoft Corporation.

2021-05-28 18:29:45.49 Server      All rights reserved.

2021-05-28 18:29:45.50 Server      Server process ID is 388.

2021-05-28 18:29:45.50 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.

2021-05-28 18:29:45.50 Server      Registry startup parameters: 

	 -d /var/opt/mssql/data/master.mdf

	 -l /var/opt/mssql/data/mastlog.ldf

	 -e /var/opt/mssql/log/errorlog

2021-05-28 18:29:45.51 Server      Error: 17113, Severity: 16, State: 1.

2021-05-28 18:29:45.51 Server      Error 87(The parameter is incorrect.) occurred while opening file '/var/opt/mssql/data/master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.

SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
Your master database file is owned by mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.

@potiuk
Copy link
Member Author

potiuk commented May 29, 2021

Ok. I think I found the reason. Seems that our docker engine is using ZFS as backing storage and MsSQL does not work with it:

microsoft/mssql-docker#13

The solution will be to change backing storage for our docker engine. It also might be (although this is less likely) that it is caused by the fact that we are using tmpfs under the hood (but I think this should have no impact whatsoever as this is one layer "deeper" in the file-system approach and docker uses a backing storage filesystem on top of the underlying tmpfs.

@potiuk
Copy link
Member Author

potiuk commented May 29, 2021

oh NO. It is the problem with tmpfs :(

This is still an issue on other file systems that do not support O_DIRECT like ramfs.

@potiuk
Copy link
Member Author

potiuk commented May 29, 2021

What we can do is to have two docker engine installation and for MsSQL we could choose the file-backed one. It will be slower, but it will work.

@potiuk
Copy link
Member Author

potiuk commented May 29, 2021

closing this PR then to solve it differently.

@potiuk potiuk closed this May 29, 2021
@ashb
Copy link
Member

ashb commented May 29, 2021

What we can do is to have two docker engine installation and for MsSQL we could choose the file-backed one. It will be slower, but it will work.

Could we volume mount a different path that isn't on tmpfs? (That seems less work then a second docker daemon)

@potiuk
Copy link
Member Author

potiuk commented May 29, 2021

Could we volume mount a different path that isn't on tmpfs? (That seems less work then a second docker daemon)

Might be better option indeed. Worth checking.

@potiuk potiuk deleted the fix-volume-location-for-mssql-to-only-empty-data branch July 29, 2022 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants