Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to 0.2.3 multi-device #38

Merged
merged 58 commits into from Jan 25, 2022
Merged

upgrade to 0.2.3 multi-device #38

merged 58 commits into from Jan 25, 2022

Conversation

Gredin67
Copy link
Collaborator

@Gredin67 Gredin67 commented Dec 7, 2021

PR Status

  • Code finished.
  • Tested with Package_check.
  • Fix or enhancement tested.
  • Upgrade from last version tested.
  • Can be reviewed and tested.

Package_check results


If you have access to App Continuous Integration for packagers you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results

Build Status

@Gredin67
Copy link
Collaborator Author

Gredin67 commented Dec 7, 2021

!testme

@yunohost-bot
Copy link
Contributor

🌻
Test Badge

@GonzaGoux
Copy link

Hi! Is there any was I can test this new version on my Yunohost? Thanks! Gonza

@Gredin67
Copy link
Collaborator Author

Gredin67 commented Dec 8, 2021

it is not ready yet, I'll let you know when it can be tested

* install pre-built
@Gredin67
Copy link
Collaborator Author

Gredin67 commented Dec 13, 2021

Is there any was I can test this new version on my Yunohost? Thanks!

@GonzaGoux You can test it now by running:
sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
or
sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug

@GonzaGoux
Copy link

Hello @Gredin67 how are you doing? I installed in a server test with Yunohost. Installed well but the bot is not joining. Here is the log data. Hope it helps! Gonza

debian@instance-debian-yunohost:~$ sudo yunohost log show 20211216-212723-app_install-mautrix_whatsapp
description: Install the 'mautrix_whatsapp' app
log_path: /var/log/yunohost/categories/operation/20211216-212723-app_install-mautrix_whatsapp.log
logs:
  - 2021-12-16 21:28:31,164: DEBUG - + action=start
  - 2021-12-16 21:28:31,164: DEBUG - + line_match=
  - 2021-12-16 21:28:31,164: DEBUG - + length=20
  - 2021-12-16 21:28:31,165: DEBUG - + log_path=/var/log/mautrix_whatsapp/mautrix_whatsapp.log
  - 2021-12-16 21:28:31,165: DEBUG - + timeout=300
  - 2021-12-16 21:28:31,165: DEBUG - + '[' start == stop ']'
  - 2021-12-16 21:28:31,165: DEBUG - + [[ -n '' ]]
  - 2021-12-16 21:28:31,165: DEBUG - + '[' start == reload ']'
  - 2021-12-16 21:28:31,165: DEBUG - + systemctl start mautrix_whatsapp
  - 2021-12-16 21:28:31,185: DEBUG - + [[ -n '' ]]
  - 2021-12-16 21:28:31,185: DEBUG - + sleep 30
  - 2021-12-16 21:29:01,188: DEBUG - + '[' 1 = true ']'
  - 2021-12-16 21:29:01,188: DEBUG - + ynh_systemd_action --service_name=mautrix_whatsapp --action=restart
  - 2021-12-16 21:29:01,188: DEBUG - + local legacy_args=nalpte
  - 2021-12-16 21:29:01,189: DEBUG - + args_array=([n]=service_name= [a]=action= [l]=line_match= [p]=log_path= [t]=timeout= [e]=length=)
  - 2021-12-16 21:29:01,189: DEBUG - + local -A args_array
  - 2021-12-16 21:29:01,189: DEBUG - + local service_name
  - 2021-12-16 21:29:01,189: DEBUG - + local action
  - 2021-12-16 21:29:01,189: DEBUG - + local line_match
  - 2021-12-16 21:29:01,189: DEBUG - + local length
  - 2021-12-16 21:29:01,189: DEBUG - + local log_path
  - 2021-12-16 21:29:01,189: DEBUG - + local timeout
  - 2021-12-16 21:29:01,189: DEBUG - + ynh_handle_getopts_args --service_name=mautrix_whatsapp --action=restart
  - 2021-12-16 21:29:01,189: DEBUG - + set +o xtrace
  - 2021-12-16 21:29:01,285: DEBUG - + service_name=mautrix_whatsapp
  - 2021-12-16 21:29:01,285: DEBUG - + action=restart
  - 2021-12-16 21:29:01,285: DEBUG - + line_match=
  - 2021-12-16 21:29:01,285: DEBUG - + length=20
  - 2021-12-16 21:29:01,285: DEBUG - + log_path=/var/log/mautrix_whatsapp/mautrix_whatsapp.log
  - 2021-12-16 21:29:01,285: DEBUG - + timeout=300
  - 2021-12-16 21:29:01,285: DEBUG - + '[' restart == stop ']'
  - 2021-12-16 21:29:01,286: DEBUG - + [[ -n '' ]]
  - 2021-12-16 21:29:01,286: DEBUG - + '[' restart == reload ']'
  - 2021-12-16 21:29:01,286: DEBUG - + systemctl restart mautrix_whatsapp
  - 2021-12-16 21:29:01,366: DEBUG - + [[ -n '' ]]
  - 2021-12-16 21:29:01,366: DEBUG - + ynh_script_progression '--message=Installation of mautrix_whatsapp completed' --last
  - 2021-12-16 21:29:01,366: DEBUG - + set +o xtrace
  - 2021-12-16 21:29:01,669: DEBUG - + set +o xtrace
  - 2021-12-16 21:29:01,687: DEBUG - + echo '! Helper used in legacy mode !'
  - 2021-12-16 21:29:01,688: DEBUG - + set +x
  - 2021-12-16 21:29:01,689: DEBUG - + echo '[####################] > Installation of mautrix_whatsapp completed'
  - 2021-12-16 21:29:01,689: DEBUG - + set -o xtrace
  - 2021-12-16 21:29:01,689: DEBUG - + ynh_exit_properly
  - 2021-12-16 21:29:01,690: DEBUG - + local exit_code=0
  - 2021-12-16 21:29:01,690: DEBUG - + rm -rf /var/cache/yunohost/download/
  - 2021-12-16 21:29:01,690: INFO - [####################] > Installation of mautrix_whatsapp completed
  - 2021-12-16 21:29:01,691: DEBUG - + '[' 0 -eq 0 ']'
  - 2021-12-16 21:29:01,691: DEBUG - + exit 0
  - 2021-12-16 21:29:02,693: DEBUG - Checking that required services are up and running...
  - 2021-12-16 21:29:05,885: SUCCESS - Installation completed
metadata:
  args:
    app: https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing
    args: None
    force: False
    label: None
    no_remove_on_failure: False
  ended_at: 2021-12-16 21:29:05
  env:
    YNH_APP_ARG_BOTADMIN: Your main Matrix account
    YNH_APP_ARG_BOTUSERS: Admin
    YNH_APP_ARG_BOT_SYNAPSE_ADM: 1
    YNH_APP_ARG_ENCRYPTION: 0
    YNH_APP_ARG_SYNAPSENUMBER: 1
    YNH_APP_ARG_WHATSAPPBOT: whatsappbot
    YNH_APP_BASEDIR: /var/cache/yunohost/app_tmp_work_dirs/app_qb90tfjo
    YNH_APP_ID: mautrix_whatsapp
    YNH_APP_INSTANCE_NAME: mautrix_whatsapp
    YNH_APP_INSTANCE_NUMBER: 1
    YNH_APP_MANIFEST_VERSION: 0.2.1~ynh1
    YNH_ARCH: amd64
  error: None
  interface: cli
  operation: app_install
  parent: None
  related_to:
    - app
    - mautrix_whatsapp
  started_at: 2021-12-16 21:27:23
  success: True
  yunohost_version: 4.3.4.2
metadata_path: /var/log/yunohost/categories/operation/20211216-212723-app_install-mautrix_whatsapp.yml
name: 20211216-212723-app_install-mautrix_whatsapp

@Gredin67
Copy link
Collaborator Author

My guess is that you have to authorize your matrix user to use the bridge in config.yaml

@Gredin67
Copy link
Collaborator Author

well, same issue here, I need to debug this

@nathanael-h
Copy link

!testme

@yunohost-bot
Copy link
Contributor

🌻
Test Badge

@nathanael-h
Copy link

Just triggered a ci build. How are tests running on your server @Gredin67 @GonzaGoux ? Do you need more tests?
+1 for using prebuilt binaires ;)

@Gredin67
Copy link
Collaborator Author

it is installing properly, but the bot is not responding, and the logs are empty. There must be some issue/ difference in the pre-built with respect to the built approach. It was a bad idea to both switch to pre-built and upgrade to multi-device in one row. It makes debugging complex...

@nathanael-h
Copy link

nathanael-h commented Dec 30, 2021

Indeed it is not so easy to find the root cause of the failure...
I read the official docs, there is no diff if we build or use prebuilt binaries.
As per changelog the config file should be updated, did you see this?

Many config fields have been changed/renamed/removed, so it is recommended to look through the example config and update your config.

https://github.com/mautrix/whatsapp/releases/tag/v0.2.0

Édit : i wrote too fast, i just saw you updated the config file

@nathanael-h
Copy link

I tried to update on testing and got an error. Here are logs : https://paste.yunohost.org/raw/ogopoxipuy
The relevant part is:

2021-12-30 22:23:27,900: DEBUG - + /opt/yunohost/mautrix_whatsapp/mautrix-whatsapp -g -c /opt/yunohost/mautrix_whatsapp/config.yaml -r /etc/matrix-synapse/app-service/mautrix_whatsapp.yaml
2021-12-30 22:23:27,901: WARNING - ./upgrade: line 176: /opt/yunohost/mautrix_whatsapp/mautrix-whatsapp: Permission denied

Should we do in upgrade like it is done in install ⬇️ ?

chown $mautrix_whatsapp_user:root -R $final_path
chmod 750 $final_path/mautrix-whatsapp

(maybe 750 instead of 755?)

@nathanael-h
Copy link

nathanael-h commented Dec 31, 2021

Just did this small PR #41 ; if you prefer I could push directly to testing or another branch in this repo. I'd just need rights to do it.

@Gredin67
Copy link
Collaborator Author

Gredin67 commented Jan 2, 2022

don't get why it used to work https://ci-apps-dev.yunohost.org/ci/job/4109
I re-run the CI because this is strange https://ci-apps-dev.yunohost.org/ci/job/4252

# Log file permissions.
file_mode: 0600
file_mode: 0o600

Choose a reason for hiding this comment

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

I think there is a conflict with this and the systemd.service.
Here we tell the app to check and fix if needed that de log file is owned by the user running the bridge (default is mautrix_whatsapp) and the perms are 600.

In the systemd service with redirect output to the same file so it is first created by root on service starting.
https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/testing/conf/systemd.service#L9

I saw with strace that when the bridge stars it loops on something related to the log file (I did not understand all the strace output by the way 😅 ). I tried to remove the output in the systemd file and it seems to let de bot starts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

still not working although erasing the log worked once. After restarting the bridge, it does not start properly. If you manage to solve this permission issue I would be greatful :)
@zamentur which chmod and chown should we set for the bridge logs and how to get the bridge happy with it in config.yaml?

@Gredin67 Gredin67 changed the title upgrade to 0.2.1 multi-device upgrade to 0.2.3 multi-device Jan 18, 2022
@Gredin67
Copy link
Collaborator Author

!testme

@yunohost-bot
Copy link
Contributor

😜
Test Badge

@Gredin67
Copy link
Collaborator Author

I would merge today if nobody opposes

Copy link
Member

@alexAubin alexAubin left a comment

Choose a reason for hiding this comment

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

Super quick review, LGTM

@Gredin67 Gredin67 merged commit 8d95063 into master Jan 25, 2022
@Gredin67 Gredin67 deleted the testing branch February 2, 2022 10:02
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.

None yet

6 participants