TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.48k stars 431 forks source link

Will not start on homeassistant anymore. 11.0 worked fine #565

Closed ChristoffBo closed 1 year ago

ChristoffBo commented 1 year ago

System.IO.IOException: The file '/install.sh' already exists. at System.IO.FileSystem.CreateDirectory(String fullPath, UnixFileMode unixCreateMode) at System.IO.Directory.CreateDirectory(String path) at DnsServerCore.DnsWebService..ctor(String configFolder, Uri updateCheckUri, Uri appStoreUri) in Z:\Technitium\Projects\DnsServer\DnsServerCore\DnsWebService.cs:line 125 at DnsServerApp.Program.Main(String[] args) in Z:\Technitium\Projects\DnsServer\DnsServerApp\Program.cs:line 54 Technitium DNS Server is stopping... Technitium DNS Server was stopped successfully.

ShreyasZare commented 1 year ago

Thanks for the post. It seems that you are running the DNS server with /install.sh as its command line parameter which is causing this issue since there is already a file with the same name. The command line option is used to specify the config folder path that must be used by the DNS server.

ChristoffBo commented 1 year ago

Hi,

Cool so I just need to rename my install.sh say to run.sh

On Sat, 25 Feb 2023, 16:24 Shreyas Zare, @.***> wrote:

Thanks for the post. It seems that you are running the DNS server with /install.sh as its command line parameter which is causing this issue since there is already a file with the same name. The command line option is used to specify the config folder path that must be used by the DNS server.

— Reply to this email directly, view it on GitHub https://github.com/TechnitiumSoftware/DnsServer/issues/565#issuecomment-1445130549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOD37K4O4OTADJKQOCX6LRDWZIIZZANCNFSM6AAAAAAVH4IIMQ . You are receiving this because you authored the thread.Message ID: @.***>

ShreyasZare commented 1 year ago

Hi, Cool so I just need to rename my install.sh say to run.sh

No. You need to check the command that is used to start the DNS server. Remove any parameter that you are passing it.

ChristoffBo commented 1 year ago

Hi

!/bin/sh

mkdir -p /data/technitium /usr/bin/dotnet /etc/dns/DnsServerApp.dll /data/technitium exit 1

That is for my storage. On Sat, 25 Feb 2023, 16:38 Shreyas Zare, @.***> wrote:

Hi, Cool so I just need to rename my install.sh say to run.sh

No. You need to check the command that is used to start the DNS server. Remove any parameter that you are passing it.

— Reply to this email directly, view it on GitHub https://github.com/TechnitiumSoftware/DnsServer/issues/565#issuecomment-1445133075, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOD37K6MUSS22Q2SXTAUOGDWZIKPDANCNFSM6AAAAAAVH4IIMQ . You are receiving this because you authored the thread.Message ID: @.***>

ChristoffBo commented 1 year ago

And this is my docker file

ARG BUILD_FROM FROM ${BUILD_FROM} ARG BUILD_ARCH COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ARG BUILD_ARCH ARG BUILD_DATE ARG BUILD_DESCRIPTION ARG BUILD_NAME ARG BUILD_REF ARG BUILD_REPOSITORY ARG BUILD_VERSION LABEL \ io.hass.name="${BUILD_NAME}" \ io.hass.description="${BUILD_DESCRIPTION}" \ io.hass.arch="${BUILD_ARCH}" \ io.hass.type="addon" \ io.hass.version=${BUILD_VERSION} \ maintainer="christoffbo (https://github.com/ChristoffBo)" \ org.opencontainers.image.title="${BUILD_NAME}" \ org.opencontainers.image.description="${BUILD_DESCRIPTION}" \ org.opencontainers.image.vendor="Home Assistant Add-ons" \ org.opencontainers.image.authors="christoffbo ( https://github.com/ChristoffBo)" \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.url="https://github.com/ChristoffBo" \ org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \ org.opencontainers.image.documentation=" https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \ org.opencontainers.image.created=${BUILD_DATE} \ org.opencontainers.image.revision=${BUILD_REF} \ org.opencontainers.image.version=${BUILD_VERSION}

On Sat, 25 Feb 2023, 16:38 Shreyas Zare, @.***> wrote:

Hi, Cool so I just need to rename my install.sh say to run.sh

No. You need to check the command that is used to start the DNS server. Remove any parameter that you are passing it.

— Reply to this email directly, view it on GitHub https://github.com/TechnitiumSoftware/DnsServer/issues/565#issuecomment-1445133075, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOD37K6MUSS22Q2SXTAUOGDWZIKPDANCNFSM6AAAAAAVH4IIMQ . You are receiving this because you authored the thread.Message ID: @.***>

ChristoffBo commented 1 year ago

Rolled back to V11.00 on my home assistant instance works fine again. V11.01 docker image works on my unraid server. Testing quick over tor. Thanks

ShreyasZare commented 1 year ago

I think the CMD in your Docker file is overwriting the CMD from the base image causing the "/install.sh" being sent as a command line parameter to the ENTRYPOINT defined in the base image.

ChristoffBo commented 1 year ago

Hi,

Ok without Mine it won't have permanent storage. So will stick to V11.0.

Thank you. And awesome software

On Sun, 26 Feb 2023, 12:03 Shreyas Zare, @.***> wrote:

I think the CMD in your Docker file is overwriting the CMD from the base image https://github.com/TechnitiumSoftware/DnsServer/blob/master/Dockerfile#L36 causing the "/install.sh" being sent as a command line parameter to the ENTRYPOINT defined in the base image.

— Reply to this email directly, view it on GitHub https://github.com/TechnitiumSoftware/DnsServer/issues/565#issuecomment-1445314550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOD37K2GWYGRXJ2XSRYQW4TWZMS5ZANCNFSM6AAAAAAVH4IIMQ . You are receiving this because you authored the thread.Message ID: @.***>

ShreyasZare commented 1 year ago

I am not an expert with docker but, I think if you define an ENTRYPOINT in your docker file instead of CMD then it would work. So try to use ENTRYPOINT [ "/run.sh" ] and see if that works.

Second issue is that you need to update your run.sh file since the docker image path for the DNS server has changed. So make it: /usr/bin/dotnet /opt/technitium/dns/DnsServerApp.dll /data/technitium

Try these changes and see if that works. Do post here to let me know.

ChristoffBo commented 1 year ago

Hi,

now i recieve the below:

The command could not be loaded, possibly because:

ChristoffBo commented 1 year ago

This is what the file looks like now:

!/bin/sh

mkdir -p /data/technitium /usr/bin/dotnet /opt/technitium/dns/DnsServerApp.dll /data/technitium

exit 1

ShreyasZare commented 1 year ago

The command could not be loaded, possibly because:

* You intended to execute a .NET application:
  The application '/opt/technitium/dns/DnsServerApp.dll' does not exist.

* You intended to execute a .NET SDK command:
  No .NET SDKs were found.
  Download a .NET SDK:
  https://aka.ms/dotnet/download
  Learn about SDK resolution:
  https://aka.ms/dotnet/sdk-not-found

Check if you have the latest DNS server base image since the new image will have that DLL file in that location.

ChristoffBo commented 1 year ago

Hi,

Tested this morning and works again for some odd reason.

You are the MAN. Thank you very much.

ShreyasZare commented 1 year ago

You're welcome. Good to know that it worked.