microsoft / mssql-docker

Official Microsoft repository for SQL Server in Docker resources
MIT License
1.74k stars 760 forks source link

Fail to run conatiner with Error "Too many open files" #856

Open raphaeliqax opened 1 year ago

raphaeliqax commented 1 year ago

I tried to simply pull and run the image with podman, but failed with error "Too many open files"

podman info:

 podman info --debug
host:
  arch: amd64
  buildahVersion: 1.31.2
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.1.7-2.fc38.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.7, commit: '
  cpuUtilization:
    idlePercent: 30.48
    systemPercent: 36.31
    userPercent: 33.21
  cpus: 6
  databaseBackend: boltdb
  distribution:
    distribution: fedora
    variant: container
    version: "38"
  eventLogger: journald
  freeLocks: 2024
  hostname: I-LEUNGRA2-W
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 524288
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 524288
      size: 65536
  kernel: 5.10.102.1-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 3324497920
  memTotal: 16663420928
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.7.0-1.fc38.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.7.0
    package: netavark-1.7.0-1.fc38.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.7.0
  ociRuntime:
    name: crun
    package: crun-1.9-1.fc38.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.9
      commit: a538ac4ea1ff319bcfe2bf81cb5c6f687e2dc9d3
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20230908.g05627dc-1.fc38.x86_64
    version: |
      pasta 0^20230908.g05627dc-1.fc38.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.1-1.fc38.x86_64
    version: |-
      slirp4netns version 1.2.1
      commit: 09e31e92fa3d2a1d3ca261adaeb012c8d75a8194
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 4294967296
  swapTotal: 4294967296
  uptime: 96h 18m 34.00s (Approximately 4.00 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /home/user/.config/containers/storage.conf
  containerStore:
    number: 6
    paused: 0
    running: 4
    stopped: 2
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/user/.local/share/containers/storage
  graphRootAllocated: 269490393088
  graphRootUsed: 17932578816
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 47
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/user/.local/share/containers/storage/volumes
version:
  APIVersion: 4.6.2
  Built: 1694549242
  BuiltTime: Wed Sep 13 04:07:22 2023
  GitCommit: ""
  GoVersion: go1.20.7
  Os: linux
  OsArch: linux/amd64
  Version: 4.6.2

output when run container : ` podman run -dt --name mssql -p 1434:1433 -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=Testing!123 mcr.microsoft.com/mssql/server:2017-latest 4594ad66d66f49d639e418557d8d32e43c7f48b4c03d0cbe7ba7ea1a3241da1d podman logs -f mssql SQL Server 2017 will run as non-root by default. This container is running as user root. To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216. The inotify_init attempt failed with File: signals.cpp:835 [Status: 0xC000011F Operation unsuccessful errno = 0x18(24) Too many open files] This program has encountered a fatal error and cannot continue running at Fri Sep 29 06:45:19 2023 The following diagnostic information is available:

     Reason: 0x00000003
     Status: 0x00000018
    Message: false
      Stack:
             IP               Function
             ---------------- --------------------------------------
             000055780be49a6c <unknown>
             000055780be494b2 <unknown>
             000055780bdb5376 <unknown>
             000055780be4d589 <unknown>
             00007fb66185b6db start_thread+0xdb
             00007fb65f3c361f clone+0x3f
    Process: 1 - sqlservr
     Thread: 5
Instance Id: 5ebd4d05-29e3-4575-9eb7-eb6d014a8603
   Crash Id: 7f34b4c7-ced1-4ca6-8553-e1b6a7dbd567
Build stamp: 440312a2b92ac556e675a19f0fd0634b459969f95d0506aa126fd28d8f93ce92

Distribution: Ubuntu 18.04.6 LTS Processors: 6 Total Memory: 16663420928 bytes Timestamp: Fri Sep 29 06:45:19 2023 Last errno: 24 Last errno text: Too many open files Capturing a dump of 1 sqlservr: utils.cpp:561: uintptr_t GetEndOfLibOSVmRange(): Assertion GetGlobals()->GetStatics()->IsLibOSVmmRangeEndValid()' failed. 2023-09-29 06:45:28.42 Server Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'. 2023-09-29 06:45:28.65 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. 2023-09-29 06:45:28.65 Server Setup step is copying system data file 'C:\templatedata\mastlog.ldf' to '/var/opt/mssql/data/mastlog.ldf'. 2023-09-29 06:45:28.67 Server Setup step is copying system data file 'C:\templatedata\model.mdf' to '/var/opt/mssql/data/model.mdf'. 2023-09-29 06:45:28.97 Server Setup step is copying system data file 'C:\templatedata\modellog.ldf' to '/var/opt/mssql/data/modellog.ldf'. 2023-09-29 06:45:29.26 Server Setup step is copying system data file 'C:\templatedata\msdbdata.mdf' to '/var/opt/mssql/data/msdbdata.mdf'. 2023-09-29 06:45:29.76 Server Setup step is copying system data file 'C:\templatedata\msdblog.ldf' to '/var/opt/mssql/data/msdblog.ldf'. 2023-09-29 06:45:30.01 Server Microsoft SQL Server 2017 (RTM-CU31-GDR) (KB5021126) - 14.0.3460.9 (X64) Jan 25 2023 08:42:43 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 18.04.6 LTS) 2023-09-29 06:45:30.02 Server UTC adjustment: 0:00 2023-09-29 06:45:30.02 Server (c) Microsoft Corporation. 2023-09-29 06:45:30.03 Server All rights reserved. 2023-09-29 06:45:30.03 Server Server process ID is 392. 2023-09-29 06:45:30.04 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'. 2023-09-29 06:45:30.04 Server Registry startup parameters: -d /var/opt/mssql/data/master.mdf -l /var/opt/mssql/data/mastlog.ldf -e /var/opt/mssql/log/errorlog 2023-09-29 06:45:30.06 Server SQL Server detected 1 sockets with 6 cores per socket and 6 logical processors per socket, 6 total logical processors; using 6 logical processors based on SQL Server licensing. This is an informational message; no user action is required. 2023-09-29 06:45:30.07 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2023-09-29 06:45:30.07 Server Detected 12713 MB of RAM. This is an informational message; no user action is required. 2023-09-29 06:45:30.07 Server Using conventional memory in the memory manager. 2023-09-29 06:45:30.14 Server Large Page Allocated: 32MB 2023-09-29 06:45:30.15 Server Page exclusion bitmap is enabled. 2023-09-29 06:45:30.47 Server Buffer pool extension is already disabled. No action is necessary. 2023-09-29 06:45:30.63 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled. 2023-09-29 06:45:30.63 Server Implied authentication manager initialization failed. Implied authentication will be disabled. 2023-09-29 06:45:30.64 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']. 2023-09-29 06:45:30.67 Server Query Store settings initialized with enabled = 1, 2023-09-29 06:45:30.73 Server Node configuration: node 0: CPU mask: 0x000000000000003f:0 Active CPU mask: 0x000000000000003f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required. 2023-09-29 06:45:30.74 Server The maximum number of dedicated administrator connections for this instance is '1' 2023-09-29 06:45:30.81 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. 2023-09-29 06:45:30.83 Server In-Memory OLTP initialized on standard machine. 2023-09-29 06:45:30.90 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. 2023-09-29 06:45:30.91 Server Software Usage Metrics is disabled. 2023-09-29 06:45:30.92 spid6s Starting up database 'master'. ForceFlush feature is enabled for log durability. 2023-09-29 06:45:31.34 spid6s Converting database 'master' from version 862 to the current version 869. 2023-09-29 06:45:31.34 spid6s Database 'master' running the upgrade step from version 862 to version 863. 2023-09-29 06:45:31.42 spid6s Database 'master' running the upgrade step from version 863 to version 864. 2023-09-29 06:45:31.50 spid6s Database 'master' running the upgrade step from version 864 to version 865. 2023-09-29 06:45:31.56 spid6s Database 'master' running the upgrade step from version 865 to version 866. 2023-09-29 06:45:31.61 spid6s Database 'master' running the upgrade step from version 866 to version 867. 2023-09-29 06:45:31.67 spid6s Database 'master' running the upgrade step from version 867 to version 868. 2023-09-29 06:45:31.71 spid6s Database 'master' running the upgrade step from version 868 to version 869. 2023-09-29 06:45:32.12 spid6s Resource governor reconfiguration succeeded. 2023-09-29 06:45:32.12 spid6s SQL Server Audit is starting the audits. This is an informational message. No user action is required. 2023-09-29 06:45:32.13 spid6s SQL Server Audit has started the audits. This is an informational message. No user action is required. 2023-09-29 06:45:32.28 spid6s SQL Trace ID 1 was started by login "sa". 2023-09-29 06:45:32.34 spid6s Server name is '4594ad66d66f'. This is an informational message only. No user action is required. 2023-09-29 06:45:32.36 spid20s Always On: The availability replica manager is starting. This is an informational message only. No user action is required. 2023-09-29 06:45:32.36 spid8s Starting up database 'mssqlsystemresource'. 2023-09-29 06:45:32.38 spid8s The resource database build version is 14.00.3460. This is an informational message only. No user action is required. 2023-09-29 06:45:32.39 spid6s Starting up database 'msdb'. 2023-09-29 06:45:32.42 spid19s Password policy update was successful. 2023-09-29 06:45:32.42 spid20s Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required. 2023-09-29 06:45:32.43 spid8s Starting up database 'model'. 2023-09-29 06:45:32.56 spid6s The tail of the log for database msdb is being rewritten to match the new sector size of 4096 bytes. 512 bytes at offset 306688 in file /var/opt/mssql/data/MSDBLog.ldf will be written. 2023-09-29 06:45:32.70 spid6s Converting database 'msdb' from version 862 to the current version 869. 2023-09-29 06:45:32.71 spid6s Database 'msdb' running the upgrade step from version 862 to version 863. 2023-09-29 06:45:32.71 spid8s The tail of the log for database model is being rewritten to match the new sector size of 4096 bytes. 2048 bytes at offset 75776 in file /var/opt/mssql/data/modellog.ldf will be written. 2023-09-29 06:45:32.79 spid19s A self-generated certificate was successfully loaded for encryption. 2023-09-29 06:45:32.94 spid8s Converting database 'model' from version 862 to the current version 869. 2023-09-29 06:45:32.95 spid8s Database 'model' running the upgrade step from version 862 to version 863. 2023-09-29 06:45:32.97 spid19s Server is listening on [ 'any' <ipv6> 1433]. 2023-09-29 06:45:32.98 spid6s Database 'msdb' running the upgrade step from version 863 to version 864. 2023-09-29 06:45:32.98 spid19s Server is listening on [ 'any' <ipv4> 1433]. 2023-09-29 06:45:33.00 Server Server is listening on [ ::1 <ipv6> 1434]. 2023-09-29 06:45:33.00 Server Server is listening on [ 127.0.0.1 <ipv4> 1434]. 2023-09-29 06:45:33.01 Server Dedicated admin connection support was established for listening locally on port 1434. 2023-09-29 06:45:33.01 spid19s SQL Server is now ready for client connections. This is an informational message; no user action is required. 2023-09-29 06:45:33.08 spid8s Database 'model' running the upgrade step from version 863 to version 864. 2023-09-29 06:45:33.10 spid6s Database 'msdb' running the upgrade step from version 864 to version 865. 2023-09-29 06:45:33.17 spid8s Database 'model' running the upgrade step from version 864 to version 865. 2023-09-29 06:45:33.17 spid6s Database 'msdb' running the upgrade step from version 865 to version 866. 2023-09-29 06:45:33.26 spid8s Database 'model' running the upgrade step from version 865 to version 866. 2023-09-29 06:45:33.28 spid6s Database 'msdb' running the upgrade step from version 866 to version 867. 2023-09-29 06:45:33.34 spid8s Database 'model' running the upgrade step from version 866 to version 867. 2023-09-29 06:45:33.37 spid6s Database 'msdb' running the upgrade step from version 867 to version 868. 2023-09-29 06:45:33.45 spid8s Database 'model' running the upgrade step from version 867 to version 868. 2023-09-29 06:45:33.47 spid6s Database 'msdb' running the upgrade step from version 868 to version 869. 2023-09-29 06:45:33.58 spid8s Database 'model' running the upgrade step from version 868 to version 869. 2023-09-29 06:45:33.87 spid8s Polybase feature disabled. 2023-09-29 06:45:33.87 spid8s Clearing tempdb database. 2023-09-29 06:45:34.14 spid8s Starting up database 'tempdb'. 2023-09-29 06:45:34.26 spid8s The tempdb database has 1 data file(s). 2023-09-29 06:45:34.28 spid24s The Service Broker endpoint is in disabled or stopped state. 2023-09-29 06:45:34.28 spid24s The Database Mirroring endpoint is in disabled or stopped state. 2023-09-29 06:45:34.30 spid24s Service Broker manager has started. 2023-09-29 06:45:34.48 spid6s Recovery is complete. This is an informational message only. No user action is required. 2023-09-29 06:45:34.50 spid20s The default language (LCID 0) has been set for engine and full-text services.