WordPress loopback error

NethServer Version: 8
Module: WordPress

Hi all, I installed WordPress module. All it’s working fine, but in “Site health” section I got “Loopback errore" and some crons fail.

Has anyone solved this yet or can help me?

Thanks in advance!

1 Like

It seems the loopback tests want to access the host which is not allowed when using the default rootless podman pasta network.

You could edit the service file to use the slirp4netns network including the allow_host_loopback option: (Assuming the wordpress app instance is named wordpress1)

runagent -m wordpress1 systemctl --user edit --full wordpress

Add the network option to the podman pod create command:

...
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/wordpress.pid \
    --pod-id-file %t/wordpress.pod-id \
    --network=slirp4netns:allow_host_loopback=true \
    --name wordpress \
    --publish 127.0.0.1:${TCP_PORT}:80 \
    --replace
...

Restart wordpress to apply the new option:

systemctl restart user@$(id -u wordpress1).service

Thanks for pointing out, I think we should include it to the wordpress app so it will survive updates, I’m going to open an issue tomorrow…

EDIT:

2 Likes

Hi @mrmarkuz! Problem solved!

1 Like

@federico.ballarini I cannot reproduce on wordpress 1.0.10

do you have some hints

2 Likes

Have you already tried in https?

1 Like

good question

that was the trick, I can reproduce @federico.ballarini @mrmarkuz

2 Likes

Nice!

released, thanks guys

2 Likes

Many thanks @stephdl and @mrmarkuz !!!

2 Likes

prego….do you come to the eroi digitalli ….I am not sure I saw you in the real life. Markuz and I will be there, close to the coffee machine and the piadina stand

2 Likes

I don’t know at the moment, if I come I’ll look for you at the coffee machine

1 Like

be warned, you have two machines at the same time :smiley:

2 Likes

Hi @stephdl and @mrmarkuz

Do you think we can add the same thing in the webserver module?
I’m using it for a wordpress installation where the user wants sftp access, and I’m getting the same error.

And this solve also another problem, that happens if you want to call (via curl or file_get_contents) a website on another webserver on the same node.

1 Like

can you test this version please ghcr.io/nethserver/webserver:1.3.1-dev.1

1 Like

It seems fine:

#
# This systemd unit starts a webserver instance using Podman.
# Most parts of this file come from podman-generate-systemd.
#

[Unit]
Description=Podman webserver.service
Requires=nginx.service
Before=nginx.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
EnvironmentFile=-%S/state/environment
Restart=always
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/webserver.pid %t/webserver.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/webserver.pid \
    --pod-id-file %t/webserver.pod-id \
    --name webserver \
    --publish 127.0.0.1:${NGINX_TCP_PORT}:80 \
    --publish  ${SFTP_TCP_PORT}:2022 \
    --publish  127.0.0.1:${SFTPGO_TCP_PORT}:8080 \
    --replace
    --network=slirp4netns:allow_host_loopback=true
ExecStart=/usr/bin/podman pod start --pod-id-file %t/webserver.pod-id
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/webserver.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/webserver.pod-id
PIDFile=%t/webserver.pid
Type=forking

[Install]
WantedBy=default.target

Webserver is up and running

no I missed

:confused:

1.3.1-dev.2 is coming

1 Like

OMG, sorry, I also didn’t catch it.
Note to myself: Don’t do reviews with the mobile app.

1 Like

You’re right! :frowning:

1 Like