No Upstream servers when restart

I have an error with PiHole in Docker, every time the container restarts:

DNSMASQ_WARN / Warning in dnsmasq core: no upstream servers configured

The upstream servers are configured (extract from setupVars.conf):

    PIHOLE_DNS_1=1.1.1.1
    PIHOLE_DNS_2=1.0.0.1
    PIHOLE_DNS_3=8.8.8.8
    PIHOLE_DNS_4=8.8.4.4

To get it work, I have to click in the UI -> Settings -> DNS -> Save, without changing anything, and then everything works, and the warning disappears.

I use this command line to create the container:

docker run -d \
    --name pihole \
    --net=host \
    --cap-add=NET_ADMIN \
    -e TZ="Europe/Paris" \
    -v "/home/docker/pihole/etc:/etc/pihole" \
    -v "/home/docker/pihole/etc-dnsmasq.d:/etc/dnsmasq.d" \
    --restart=unless-stopped \
    --hostname xxx.local.domain.fr \
    -e PIHOLE_DNS_="1.1.1.1;1.0.0.1;8.8.8.8;8.8.4.4" \
    -e VIRTUAL_HOST="xxx.local.domain.fr" \
    -e PROXY_LOCATION="xxx.local.domain.fr" \
    -e FTLCONF_LOCAL_IPV4="192.168.1.40" \
    pihole/pihole:latest

I use it for DHCP server too.

One more thing, before I have it on a Raspberry, but it is dead now, so I use a computer with a Debian OS. I copied all files from volumes directory the new computer. I tried to change permission on the file, but I have the same problem.

Is this a bug or something wrong with my installation?

This is likely your issue, and it would be contributing to your observation.

Docker needs specific permissions to access mounts.
Copying files from a bare metal installation is likely to trigger permission issues.

Those permission issues may well prevent Docker to successfully populate your Pi-hole container's dnsmasq configuration files, resulting in the message you see.

To explore a path to a solution, I'd recommend to stop and throw away your container, and delete your copied files or better even the mount directories themselves (i.e. from your host's file system, not from the docker run script).
Creating and starting a fresh container would prompt Docker to create the mount directories with the required contents, including correct permissions.
If you'd need to import old settings, paste the contents to files, rather than copying files themselves.

You should further note that configuring Pi-hole's upstream DNS resolvers via its container's PIHOLE_DNS_ enironment variable or via PI-hole's web UI should be treated as mutually exclusive.
If you would accidentally use both, PIHOLE_DNS_ would always win with a fresh container, potentially overwriting any UI settings.

I moved the mount directories to another place and create a new container from scratch.
I used the Teleporter functionnality to restore my previous settings and it worked like a charm.

Now, I can restart the container without any issues.

For the PIHOLE_DNS_ I knew it, but thanks for the reminder.

Thank you so much for your help.