Skip to content

restart update_synapse_for_appservice.sh broken for whatsapp#580

Open
nin0-0 wants to merge 1 commit into
YunoHost-Apps:masterfrom
nin0-0:patch-1
Open

restart update_synapse_for_appservice.sh broken for whatsapp#580
nin0-0 wants to merge 1 commit into
YunoHost-Apps:masterfrom
nin0-0:patch-1

Conversation

@nin0-0

@nin0-0 nin0-0 commented Oct 18, 2025

Copy link
Copy Markdown

improve app service error handling for successful run

Problem

old log location matrix-synapse

  • Description of why you made this PR
    broke my whatsapp bridge

Solution

remove those wait for and log path line + added if logic for better exit 1 on fail

PR Status

  • Code finished and ready to be reviewed/tested
  • The fix/enhancement were manually tested (if applicable)

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

improve app service error handling for successful run
@nin0-0

nin0-0 commented Oct 18, 2025

Copy link
Copy Markdown
Author

!testme

@Josue-T Josue-T left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, for the review. To it's good to bring some more improvement on this script but I also would like to stay consistent for the systemd helper call with the other scripts.

chmod 600 "$service_config_file"

set +e
ynh_systemctl --service="$app".service --action=restart --wait_until="Synapse now listening on TCP port $port_synapse_tls" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I would prefer to keep the same parameter than on the install/upgrade script

ynh_systemctl --service="$app".service --action=restart --wait_until="Synapse now listening on TCP port $port_synapse_tls" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these checks in a log file are solid, I've had to echo "somestrings" before because an install was failing when the log messages were changed/not appearing, even when the service was started and active.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but in this case can you please report the issue so we can fix it everywhere and not just in this script.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be I am having a more general logging issue? I haven't had the log message in that log since a week - maybe I'm trying to solve a me-issue only

if any idea, let me know, we can close for now

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well at last on my side and on the CI we don't seem to have any issue like this. I mean Yunhost correctly detect when the service started and we don't end on the timeout.

else
# Wait a moment and verify service is actually running
sleep 5
if ! systemctl is-active --quiet "$app"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that it's more strong, because even if it fail as the service will try to restart depending on when you do the check, it might return that it's active even if it crashed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe need to put is-failed instead of is-active?

is-active PATTERN... Check whether units are active
is-failed PATTERN... Check whether units are failed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well yes maybe, to me we need a strong way to check that the service fully started without crashing at some point and it's from my experience what was doing the current code. Now if this not working as expected maybe we just need to understand why and maybe fix the helper itself.

The idea also of this way we check the startup is that we are sure that synapse fully started when we go out of ynh_systemctl and this time could really depends of servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants