Forum Discussion

michaeljurek's avatar
michaeljurek
Copper Contributor
Sep 08, 2024

SqlPackage halts for 100 seconds without apparent reason

I am running sqlpackage tool version 162.3.566.1 in Docker container image mcr.microsoft.com/dotnet/runtime:6.0 and/or Ubuntu base image and there is very strange behavior. Overall it works fine. But for some reason I can't understand why it stops for 100 seconds. Diagnostic log looks like this:

 

Microsoft.Data.Tools.Diagnostics.Tracer Information: 25 : 2024-09-06T13:42:34 : Perf: Operation ended (name, details, elapsed in ms): Updating database,,265

Updating database (Complete)

*** HERE IT WAITS FOR 100 SECONDS WITHOUT ANY APPARENT REASON ****

Successfully published database.

Changes to connection setting default values were incorporated in a recent release.  More information is available at https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fdacfx-connection&data=05%7C02%7C%7C466432aa287845b32eaf08dcce6a546c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638612203275899397%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=S0hslmUzYYgozxpKntrNi0Xw8tXXRGcBxUCaLGL8O3c%3D&reserved=0

Microsoft.Data.Tools.Diagnostics.Tracer Information: 18 : 2024-09-06T13:44:14 : Time elapsed: 0:01:46.30.

Time elapsed 0:01:46.30

Microsoft.Data.Tools.Diagnostics.Tracer Information: 0 : 2024-09-06T13:44:14 : SqlPackage completed

 

Any idea what can be the culprit???

2 Replies

  • jbnumber1's avatar
    jbnumber1
    Copper Contributor

    I ran into the same symptoms. The clue here is the 100 second delay, which is often a default HTTP timeout in .NET (which sqlpackage is written in). When running the container on my machine I received no delay, but remotly in a cluster I experienced the delay. In my case, the delay seemed to be related to sending telemetry to Microsoft, which is always on by default. After turning the telemetry off, the delays went away. I suspect this is due to the locked down network environment in which my container was running. You might also get around this issue by opening up appropriate networking to Microsoft, but I have not attempted this option.

    Just add this line to your Dockerfile to disable telemetry send:

    ENV DACFX_TELEMETRY_OPTOUT=true

    https://github.com/microsoft/DacFx/blob/f13dcbd26d15e1636335c25204a475909bde494c/src/Microsoft.Build.Sql/README.md#how-to-opt-out

    • michaeljurek's avatar
      michaeljurek
      Copper Contributor

      Hi jbnumber1​ !
      You nailed it, thanks a lot. You are right, exactly hundred 100 seconds were suspicious but I would not think that:
      1. The telemetry is on by default without notification (or did I miss something)
      2. It will not timeout after 1 or 2 seconds.
      This is a shame for the code owner.

Resources