My pod for SQL Server 2019 is in a CrashLoopBackOff, and I cannot find the reason why.
The main error messages are
Error: 17204, Severity: 16, State: 1. FCB::Open failed: Could not open file /var/opt/mssql/data/master.mdf for file number 1. OS error: 5(Access is denied.).
Error: 5120, Severity: 16, State: 101. Unable to open the physical file "/var/opt/mssql/data/master.mdf". Operating system error 5: "5(Access is denied.)".
Rebuild/Reroll/Reinstall/Reapply did not help in my case. It must be something on the surface. Please advice
my mssql-depl.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: mssql-depl spec: replicas: 1 selector: matchLabels: app: mssql template: metadata: labels: app: mssql spec: containers: - name: mssql image: mcr.microsoft.com/mssql/server:2019-latest ports: - containerPort: 1433 env: - name: MSSQL_PID value: "Express" - name: ACCEPT_EULA value: "Y" - name: MSSQL_SA_PASSWORD valueFrom: secretKeyRef: name: mssql key: SA_PASSWORD volumeMounts: - mountPath: /var/opt/mssql/data name: mssqldb volumes: - name: mssqldb persistentVolumeClaim: claimName: mssql-claim --- apiVersion: v1 kind: Service metadata: name: mssql-clusterip-srv spec: type: ClusterIP selector: app: mssql ports: - name: mssql protocol: TCP port: 1433 targetPort: 1433 --- apiVersion: v1 kind: Service metadata: name: mssql-loadbalancer spec: type: LoadBalancer selector: app: mssql ports: - protocol: TCP port: 1433 targetPort: 1433
log from the pod
SQL Server 2019 will run as non-root by default. This container is running as user mssql. Your master database file is owned by root. To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216. 2022-01-22 18:43:58.08 Server The licensing PID was successfully processed. The new edition is [Express Edition]. 2022-01-22 18:43:58.69 Server Setup step is FORCE copying system data file 'C:\templatedata\model_replicatedmaster.mdf' to '/var/opt/mssql/data/model_replicatedmaster.mdf'. 2022-01-22 18:43:58.72 Server Setup step is FORCE copying system data file 'C:\templatedata\model_replicatedmaster.ldf' to '/var/opt/mssql/data/model_replicatedmaster.ldf'. 2022-01-22 18:43:58.75 Server Setup step is FORCE copying system data file 'C:\templatedata\model_msdbdata.mdf' to '/var/opt/mssql/data/model_msdbdata.mdf'. 2022-01-22 18:43:58.79 Server Setup step is FORCE copying system data file 'C:\templatedata\model_msdblog.ldf' to '/var/opt/mssql/data/model_msdblog.ldf'. 2022-01-22 18:43:58.90 Server Microsoft SQL Server 2019 (RTM-CU14) (KB5007182) - 15.0.4188.2 (X64) Nov 3 2021 19:19:51 Copyright (C) 2019 Microsoft Corporation Express Edition (64-bit) on Linux (Ubuntu 20.04.3 LTS) <X64> 2022-01-22 18:43:58.91 Server UTC adjustment: 0:00 2022-01-22 18:43:58.91 Server (c) Microsoft Corporation. 2022-01-22 18:43:58.91 Server All rights reserved. 2022-01-22 18:43:58.91 Server Server process ID is 360. 2022-01-22 18:43:58.92 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'. 2022-01-22 18:43:58.92 Server Registry startup parameters: -d /var/opt/mssql/data/master.mdf -l /var/opt/mssql/data/mastlog.ldf -e /var/opt/mssql/log/errorlog 2022-01-22 18:43:58.93 Server SQL Server detected 1 sockets with 4 cores per socket and 8 logical processors per socket, 8 total logical processors; using 8 logical processors based on SQL Server licensing. This is an informational message; no user action is required. 2022-01-22 18:43:58.94 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2022-01-22 18:43:58.95 Server Detected 3095 MB of RAM. This is an informational message; no user action is required. 2022-01-22 18:43:58.95 Server Using conventional memory in the memory manager. 2022-01-22 18:43:58.96 Server Page exclusion bitmap is enabled. 2022-01-22 18:43:59.00 Server Buffer pool extension is not supported on Linux platform. 2022-01-22 18:43:59.00 Server Buffer Pool: Allocating 524288 bytes for 263827 hashPages. 2022-01-22 18:43:59.31 Server Buffer pool extension is already disabled. No action is necessary. 2022-01-22 18:44:00.21 Server Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA']. 2022-01-22 18:44:00.30 Server Query Store settings initialized with enabled = 1, 2022-01-22 18:44:00.35 Server The maximum number of dedicated administrator connections for this instance is '1' 2022-01-22 18:44:00.36 Server Node configuration: node 0: CPU mask: 0x00000000000000ff:0 Active CPU mask: 0x00000000000000ff:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required. 2022-01-22 18:44:00.40 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required. 2022-01-22 18:44:00.44 Server In-Memory OLTP initialized on lowend machine. 2022-01-22 18:44:00.50 Server [INFO] Created Extended Events session 'hkenginexesession' 2022-01-22 18:44:00.51 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required. ForceFlush is enabled for this instance. 2022-01-22 18:44:00.64 Server Total Log Writer threads: 2. This is an informational message; no user action is required. 2022-01-22 18:44:00.92 Server clflushopt is selected for pmem flush operation. 2022-01-22 18:44:00.93 Server Software Usage Metrics is disabled. 2022-01-22 18:44:01.04 spid9s [1]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1. 2022-01-22 18:44:01.05 spid9s Starting up database 'master'. 2022-01-22 18:44:01.11 spid9s Error: 17204, Severity: 16, State: 1. 2022-01-22 18:44:01.11 spid9s FCB::Open failed: Could not open file /var/opt/mssql/data/master.mdf for file number 1. OS error: 5(Access is denied.). 2022-01-22 18:44:01.13 spid9s Error: 5120, Severity: 16, State: 101. 2022-01-22 18:44:01.13 spid9s Unable to open the physical file "/var/opt/mssql/data/master.mdf". Operating system error 5: "5(Access is denied.)". 2022-01-22 18:44:01.24 spid9s Error: 17204, Severity: 16, State: 1. 2022-01-22 18:44:01.24 spid9s FCB::Open failed: Could not open file /var/opt/mssql/data/mastlog.ldf for file number 2. OS error: 5(Access is denied.). 2022-01-22 18:44:01.26 spid9s Error: 5120, Severity: 16, State: 101. 2022-01-22 18:44:01.26 spid9s Unable to open the physical file "/var/opt/mssql/data/mastlog.ldf". Operating system error 5: "5(Access is denied.)".