Screenly / Anthias

The world's most popular open source digital signage project.
https://anthias.screenly.io
Other
2.51k stars 623 forks source link

Settings page produces 504 Gateway Time-out #2013

Closed Pubec closed 3 months ago

Pubec commented 3 months ago

Overview of the Issue

Opening settings page produces 504 Gateway Time-out.

Reproduction Steps

Environment

nicomiguelino commented 3 months ago

@Pubec, while investigation is in progress, I'd like to ask a few questions:

In common situations, you don't need to run bash bin/upgrade_containers.sh, unless the install script instructed you to do so.

nicomiguelino commented 3 months ago

@Pubec, I tried to reproduced the issue but didn't replicated it. I answered y to all questions except the question that asks if I'd like to install the experimental version of Anthias. master is at 6b8b0d0.

I also didn't get an HTTP 504 from the settings page in experimental@84bd4ab.

Pubec commented 3 months ago

To answer the questions:

Logs:

nicomiguelino commented 3 months ago

Thanks, @Pubec. With your logs, I already found the root cause: host_agent_service is not ready after 60 retries usually happens when retrieval of the device's IP address failed. I'll let you know when it's fixed.

In the meantime, I'd like to request specific logs from the system journal. You can do so by running sudo journalctl -fu anthias-host-agent, specifically during the time that the browser attempts to load the settings page.

Would you also be able to provide a screenshot of your browser at http://<ip_address>/splash-page?

Pubec commented 3 months ago

Thanks @nicomiguelino . I've noticed the same error, and I've tried checking the journalctl -fu anthias-host-agent, but that provides me zero output, like there was nothing going on, even though anthias is running and working.

I can not get to /splash-page, but I can to main menu:

image
nicomiguelino commented 3 months ago

@Pubec, I recently created #2014 in an attempt to fix the issue. I'll keep you posted. Do you get a white screen or something on /splash-page?

Pubec commented 3 months ago

@nicomiguelino I get a 504 Gateway Time-out aswell as at /settings

Could it possibly be a network manager issue, as I used nmtui to set fixed ip, with 23-bit netmask.

nicomiguelino commented 3 months ago

@Pubec, I added a snippet in the settings view/controller that gets the IP. I'm not sure if that's a Network Manager issue. Do you get similar issues if the IP addresses are not fixed?

Pubec commented 3 months ago

@nicomiguelino should I checkout to to nicomiguelino:fix-2013 branch and try to rebuild containers?

I can try removing connection from Network Manager with fixed IP.

nicomiguelino commented 3 months ago

@Pubec, no not yet. I still have to have it approved and merged. You can try disabling fixed IP first.

Pubec commented 3 months ago

@nicomiguelino I've tried with fixed IP removal, and rebooted, but the problem persists. Only / and /system-info is accessible.

nicomiguelino commented 3 months ago

@Pubec, I'll see what I can do. I an make some changes, just for you to test if out quickly as soon as possible, even if it's still not merged. I'll give you the command later, just make sure to back up your data first before proceeding.

nicomiguelino commented 3 months ago

@Pubec, once you've backed up your data, you can run the following to install a version of Anthias with my patches:

bash <(curl -sL https://raw.githubusercontent.com/nicomiguelino/Anthias/test-fix-2013/bin/install.sh)

Do take note that this is only temporary. If this went well, I'll have the pull request merge, then I'll let you know when changes to master is ready.

Pubec commented 3 months ago

Whilst installing I did notice an error:

E: Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/debian/ bookworm: /etc/apt/keyrings/docker.asc !=
E: The list of sources could not be read

Will get back with new updates as soon as docker pull finishes

Pubec commented 3 months ago

Update finished, with error persisting: docker logs screenly-anthias-server-1 produces host_agent_service is not ready after 60 retries

nicomiguelino commented 3 months ago

@Pubec, you've said earlier that you got nothing when you ran journalctl -fu anthias-host-agent. It could be that Anthias is not properly and fully installed in your device.

You can also check if anthias-host-agent.service (or similar) is present inside the /etc/systemd/system directory.

If it's not too much on your end, can you do the installation from scratch and take note of the console output from start to finish (until the part where the script prompts you to reboot now or later). At that point, don't reboot your Pi yet, as you still need to get those console logs.

Pubec commented 3 months ago

@nicomiguelino, unfortunately, there is nothing similar in /etc/systemd/system directory.

For a fresh install, should I reinstall Raspberry Pi OS as well?

nicomiguelino commented 3 months ago

@Pubec, yes it's recommended to reinstall Raspberry Pi OS at this point. Here's a screenshot of my terminal (that shows the contents of /etc/systemd/system) for reference: image

Pubec commented 3 months ago

With fresh install everyting works as expected, with anthias-host-agent.service located in /etc/systemd/system. I guess an installation failure.

nicomiguelino commented 3 months ago

@Pubec. I'll be closing this for now. If the issue occurs again, please re-open this and include logs where the failure happened, for instance, in the installation script.