Closed christianbraeunlich closed 1 year ago
We're experiencing the same issue. The issue started appearing today. We have three server hosting containers for our QA. They are all experiencing the same issue. Containers created on friday are still up, running and reachable. We are running Docker Enterprise on Windows Server 2019 (1809)
We also recreate the traefik container each night. Since this image (1.7.34) is also 3 months old, I don't think it's the issue
I downgraded to v 4.0.7 of BcContainerHelper (not sure whether the issue appeared with .8 or .9) and recreated the container which didn't help. Then I recreated the traefik container and then recreated the container again, now everything seems to be working again.
In future to make it easier to find what got released in which version of bccontainerhelper it would be very helpful if you could add tags when you release a new version so it's easier to compare releases. I'm sorry I don't have time to look for what's actually going on but it must be a change between 4.0.7 and 4.0.9.
Nothing has changed in this area for a very long time. @christianbraeunlich - I think you are right in the fact that your npipe is different - will investigate that. @itsme112358 - Are you running PowerShell as administrator?
Look what I just found: https://www.axians-infoma.de/techblog/allow-access-to-the-docker-engine-without-admin-rights-on-windows - @tfenster also mentioned the docker_engine_windows. Maybe you'd like to share some insights? @itsme112358 can you check the content of the C:\ProgramData\Docker\config\daemon.json file. btw: love the git tag suggestion
@christianbraeunlich - that code is built into Check-BcContainerHelperPermissions and will add permissions to this. This code has changed in 4.0.8 due to PS 7
@freddydk Thanks for the quick reply. Yes, everything is run via a Azure DevOps Agent which has local admin privileges. I also ran the scripts myself as admin, same results. And as mentioned, it now works, after going back to 4.0.7. I'm guessing it has to have something to do with the traefik container's configuration since it only worked after I recreated it (but also only after going back to 4.0.7; just recreating it, even rebooting did not solve it)
Look what I just found: https://www.axians-infoma.de/techblog/allow-access-to-the-docker-engine-without-admin-rights-on-windows - @tfenster also mentioned the docker_engine_windows. Maybe you'd like to share some insights? @itsme112358 can you check the content of the C:\ProgramData\Docker\config\daemon.json file. btw: love the git tag suggestion
Do you run this with Docker Desktop? I think that is the only way how you can end up with a docker_engine_windows
npipe
@itsme112358 - I have moved your issue to a new issue - I don't think that is related to Docker Desktop and the original problem
You are correct, I didn't read the error message correctly, I just read that there was an issue with the named pipe, which it seemed to fit with my issue. Plus it fit the timing 🙈 Sorry about that! See you over there ;)
@christianbraeunlich - is this still an issue?
I've just checked in with the info on my working pc (win10) and the content of the deamon.json is also:
{
"experimental": false,
"hosts": [
"npipe:////./pipe/docker_engine_windows"
]
}
So as Tobias pointed out, it might be the fact that I run Docker Desktop. Don't really know.. I created a workaround for myself by using the Docker Image from Tobias and create all containers with additional parameters, providing the docker labels that Traefik makes use of. So for me the script in this module still does not work, but it might be an edge case. So if anyone else might come up with similar problems in the future we can reference to this issue.
Ok, thanks I don't think docker desktop (and Windows 10) is the primary target for Traefik and in the end - if people switch to docker Engine instead of Docker Desktop - it should work. Will close this as won't fix
Hello there, I was trying to setup some containers using traefik after a long period of time. I think it used to work right of the bat for me, but now I catch some errors which I think is mostly related to docker itself. I like to share the information, get some guidance into the right direction - which is very much appreciated - and maybe contribute if neccessary. Thanks in advance!
FYI: I got it working after a few days: with the latest image of
tobiasfenster/traefik-for-windows:2.9.6
and manually creating the labels for the container. I've also had to migrate the scripts to Traefik 2 and replacepipe/docker_engine
withpipe/docker_engine_windows
(this is not only true to thetraefik.yml
but also when mounting the volume.Describe the issue
When executing the Setup-TraefikContainerForBcContainer.ps1 script it successfully creates the traefik container (tobiasfenster/traefik-for-windows:1.7.34). Opening the terminal of this container shows that there was no connection established to the Docker Daemon:
Provider connection error error during connect: Get \"http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version\": open //./pipe/docker_engine: message readmode pipes not supported In the default daemon configuration on Windows
.This blocks traefik from being able to discover the lables of other docker containers. If I would be able to select a docker daemon I could select npipe:////./pipe/docker_engine_windows and I expect it to work.
Maybe you have some insights for me as I also think my setup is a bit off due to the _windows suffix.
Thank you for your help!
Scripts used to create container and cause the issue
Setup-TraefikContainerForBcContainer.ps1
Full output of Setup-TraefikContainerForBcContainer.ps1 script
```powershell Creating folder structure at c:\programdata\bccontainerhelper\traefikforbc Verzeichnis: C:\programdata\bccontainerhelper Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 02.01.2023 14:02 traefikforbc Verzeichnis: C:\programdata\bccontainerhelper\traefikforbc Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 02.01.2023 14:02 0 traefik.txt d----- 02.01.2023 14:02 my d----- 02.01.2023 14:02 config Verzeichnis: C:\programdata\bccontainerhelper\traefikforbc\config Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 02.01.2023 14:02 0 acme.json Create traefik config file Traefik image already up to date Running traefik 464218f1ba337d6fde715efc6608d936ab0a873c146a69fe8aeb53db4db0ea66 True ```So far, so good. Now if we take a look into the terminal of the created container we will see lots of errors:
In the end, this is what blocks traefik from discovering other containers.
The content of the C:\ProgramData\Docker\config\daemon.json:
I barely see the named pipe with the suffix _windows in any documentation or forum. I also reinstalled the entire OS + Docker, but it stays the same.
I post my container creation script and output as well just for the record.
New-BcContainerUseTraefik.ps1
Full output of New-BcContainerUseTraefik.ps1.ps1 script
```powershell BcContainerHelper is version 4.0.8-preview840 BcContainerHelper is running as administrator Hyper-V is Enabled UsePsSession is True Host is Microsoft Windows 11 Pro - 21H2 Docker Client Version is 20.10.21 Docker Server Version is 20.10.21 Removing entries from hosts Removing bcserver from container hosts file Removing bcserver-* from container hosts file Removing Desktop shortcuts Removing C:\ProgramData\BcContainerHelper\Extensions\bcserver Fetching all docker images Fetching all docker volumes Enabling SSL as otherwise all clients will see mixed HTTP / HTTPS request, which will cause problems e.g. on the mobile and modern windows clients Using image mcr.microsoft.com/businesscentral:10.0.20348.1249-dev PublicDnsName is cbnotebook Creating Container bcserver Style: onprem Multitenant: No Version: 21.2.49946.49990 Platform: 21.0.49939.49984 Generic Tag: 1.0.2.13-dev Container OS Version: 10.0.20348.1249 (ltsc2022) Host OS Version: 10.0.22000.1335 (21H2) Using hyperv isolation Using locale en-US Adding special CheckHealth.ps1 to enable Traefik support Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable) Additional Parameters: -e webserverinstance=bcserver -e publicdnsname=cbnotebook -l "traefik.protocol=https" -l "traefik.web.frontend.rule=PathPrefix:/bcserver" -l "traefik.web.port=443" -l "traefik.soap.frontend.rule=PathPrefix:/bcserversoap;ReplacePathRegex: ^/bcserversoap(.*) /BC$1" -l "traefik.soap.port=7047" -l "traefik.rest.frontend.rule=PathPrefix:/bcserverrest;ReplacePathRegex: ^/bcserverrest(.*) /BC$1" -l "traefik.rest.port=7048" -l "traefik.dev.frontend.rule=PathPrefix:/bcserverdev;ReplacePathRegex: ^/bcserverdev(.*) /BC$1" -l "traefik.dev.port=7049" -l "traefik.snap.frontend.rule=PathPrefix:/bcserversnap;ReplacePathRegex: ^/bcserversnap(.*) /BC$1" -l "traefik.snap.port=7083" -l "traefik.dl.frontend.rule=PathPrefixStrip:/bcserverdl" -l "traefik.dl.port=8080" -l "traefik.dl.protocol=http" -l "traefik.enable=true" -l "traefik.frontend.entryPoints=https" --env customNavSettings=PublicODataBaseUrl=https://cbnotebook/bcserverrest/odata,PublicSOAPBaseUrl=https://cbnot ebook/bcserversoap/ws,PublicWebBaseUrl=https://cbnotebook/bcserver Files in C:\ProgramData\BcContainerHelper\Extensions\bcserver\my: - AdditionalOutput.ps1 - CheckHealth.ps1 - MainLoop.ps1 - SetupVariables.ps1 - updatehosts.ps1 Creating container bcserver from image mcr.microsoft.com/businesscentral:10.0.20348.1249-dev 7d02741f8089dba2ec1df18a809f61521346b7aed1d360d55142c19bdfeb4392 Waiting for container bcserver to be ready Using artifactUrl https://bcartifacts.azureedge.net/onprem/21.2.49946.49990/us Using installer from C:\Run\210-new Installing Business Central Installing from artifacts Starting Local SQL Server Starting Internet Information Server Copying Service Tier Files c:\dl\onprem\21.2.49946.49990\platform\ServiceTier\Program Files c:\dl\onprem\21.2.49946.49990\platform\ServiceTier\System64Folder Copying PowerShell Scripts c:\dl\onprem\21.2.49946.49990\platform\WindowsPowerShellScripts\Cloud\NAVAdministration c:\dl\onprem\21.2.49946.49990\platform\WindowsPowerShellScripts\WebSearch Copying Web Client Files c:\dl\onprem\21.2.49946.49990\platform\WebClient\Microsoft Dynamics NAV Copying ModernDev Files c:\dl\onprem\21.2.49946.49990\platform c:\dl\onprem\21.2.49946.49990\platform\ModernDev\program files\Microsoft Dynamics NAV Copying additional files Copying ConfigurationPackages C:\dl\onprem\21.2.49946.49990\us\ConfigurationPackages Copying Test Assemblies C:\dl\onprem\21.2.49946.49990\platform\Test Assemblies Copying Applications C:\dl\onprem\21.2.49946.49990\us\Applications Copying dependencies Copying ReportBuilder Importing PowerShell Modules Restoring CRONUS Demo Database Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS Modifying Business Central Service Tier Config File for Docker Creating Business Central Service Tier Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll' Starting Business Central Service Tier Importing license file Stopping Business Central Service Tier Installation took 211 seconds Installation complete Initializing... Setting host.docker.internal to 192.168.0.34 in container hosts file (copy from host hosts file) Setting gateway.docker.internal to 192.168.0.34 in container hosts file (copy from host hosts file) Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file) Setting host.containerhelper.internal to 172.23.144.1 in container hosts file Starting Container Hostname is bcserver PublicDnsName is cbnotebook WARNING: Container starts with TimeZone = Mitteleuropäische Zeit, which is not recognized in the list of TimeZo nes. Using NavUserPassword Authentication Creating Self Signed Certificate Self Signed Certificate Thumbprint B19AED3092197D2A95565F1A05B09679CD19EBE8 DNS identity cbnotebook Modifying Service Tier Config File with Instance Specific Settings Modifying Service Tier Config File with settings from environment variable Setting PublicODataBaseUrl to https://cbnotebook/bcserverrest/odata Setting PublicSOAPBaseUrl to https://cbnotebook/bcserversoap/ws Setting PublicWebBaseUrl to https://cbnotebook/bcserver Starting Service Tier CertificateThumprint B19AED3092197D2A95565F1A05B09679CD19EBE8 Registering event sources Creating DotNetCore Web Server Instance Using application pool name: bcserver Using default container name: NavWebApplicationContainer Copy files to WWW root C:\inetpub\wwwroot\bcserver Create the application pool bcserver Create website: NavWebApplicationContainer with SSL Update configuration: navsettings.json Done Configuring Web Client Creating http download site Setting SA Password and enabling SA Creating admin as SQL User and add to sysadmin Creating SUPER user Container IP Address: 172.23.148.246 Container Hostname : bcserver Container Dns Name : cbnotebook Web Client : https://cbnotebook/bcserver/ Dev. Server : https://cbnotebook Dev. ServerInstance : BC Setting bcserver to 172.23.148.246 in host hosts file Files: http://cbnotebook:8080/ALLanguage.vsix http://cbnotebook:8080/certificate.cer Container Total Physical Memory is 8.5Gb Container Free Physical Memory is 6.6Gb Initialization took 75 seconds Ready for connections! Reading CustomSettings.config from bcserver Container bcserver successfully created Because of Traefik, the following URLs need to be used when accessing the container from outside your Docker host: Web Client: https://cbnotebook/bcserver SOAP WebServices: https://cbnotebook/bcserversoap OData WebServices: https://cbnotebook/bcserverrest Dev Service: https://cbnotebook/bcserverdev Snapshot Service: https://cbnotebook/bcserversnap File downloads: https://cbnotebook/bcserverdl Health check returns False, restarting container Removing Session bcserver bcserver Waiting for container bcserver to be ready Initializing... Setting host.docker.internal to 192.168.0.34 in container hosts file (copy from hos t hosts file) Setting gateway.docker.internal to 192.168.0.34 in container hosts file (copy from host hosts file) Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file) Setting host.containerhelper.internal to 172.23.144.1 in container hosts file Restarting Container PublicDnsName unchanged Hostname is bcserver PublicDnsName is cbnotebook Using NavUserPassword Authentication Starting Local SQL Server Starting Internet Information Server Starting Service Tier Container IP Address: 172.23.145.207 Container Hostname : bcserver Container Dns Name : cbnotebook Web Client : https://cbnotebook/bcserver Dev. Server : https://cbnotebook Dev. ServerInstance : BC Setting bcserver to 172.23.145.207 in host hosts file Files: http://cbnotebook:8080/ALLanguage.vsix http://cbnotebook:8080/certificate.cer Container Total Physical Memory is 8.5Gb Container Free Physical Memory is 7.0Gb Initialization took 52 seconds Ready for connections! Use: Get-BcContainerEventLog -containerName bcserver to retrieve a snapshot of the event log from the container Get-BcContainerDebugInfo -containerName bcserver to get debug information about the container Enter-BcContainer -containerName bcserver to open a PowerShell prompt inside the co ntainer Remove-BcContainer -containerName bcserver to remove the container again docker logs bcserver to retrieve information about URL's again ```Systeminformation
Docker Desktop 4.15.0 (93002)
![docker-settings](https://user-images.githubusercontent.com/25108568/210237916-38770ccb-89bc-4c40-9fca-e64ce3796e25.png)