YunoHost-Apps / mautrix_telegram_ynh

Matrix Telegram pupetting bridge for YunoHost
https://github.com/mautrix/telegram
GNU General Public License v3.0
14 stars 4 forks source link

Can't install on Yunohost 11 with end-to-bridge encryption enabled #28

Closed marcoil closed 1 year ago

marcoil commented 1 year ago

Trying to install on Yunohost 11 with encryption enabled generates an incorrect apt list file that stops the installation process and breaks the system.

Context

Steps to reproduce

  1. Start the installation from the webadmin.
  2. Enable end-to-bridge encryption.
  3. This creates the file /etc/apt/sources.list/mautrix_telegram.list with
deb libolm-dev  libolm-dev

Logs

I can't attach the logs directly because they contain my Telegram API ids, so I'm pasting them here with the relevant bits edited:

args:
  app: mautrix_telegram
  force: false
  label: Matrix-Telegram bridge
  no_remove_on_failure: false
ended_at: 2022-09-17 11:27:35.668794
env:
  YNH_APP_ARG_APIHASH: XXXXXXX
  YNH_APP_ARG_APIID: 'XXXXXXX'
  YNH_APP_ARG_BOTADMIN: '@marc:domain2.tld'
  YNH_APP_ARG_BOTNAME: telegrambot
  YNH_APP_ARG_BOTTOKEN: '**********'
  YNH_APP_ARG_BOTUSERS: local
  YNH_APP_ARG_ENCRYPTION: '1'
  YNH_APP_ARG_SYNAPSENUMBER: '1'
  YNH_APP_BASEDIR: /var/cache/yunohost/app_tmp_work_dirs/app_ziwgg85h
  YNH_APP_ID: mautrix_telegram
  YNH_APP_INSTANCE_NAME: mautrix_telegram
  YNH_APP_INSTANCE_NUMBER: '1'
  YNH_APP_MANIFEST_VERSION: 0.11.3~ynh2
  YNH_ARCH: amd64
error: "Hi ha hagut un error en el script d'instal\xB7laci\xF3 de l'aplicaci\xF3"
interface: api
operation: app_install
parent: null
related_to:
- - app
  - mautrix_telegram
started_at: 2022-09-17 11:27:32.008732
success: false
yunohost_version: 11.0.9.14

============

2022-09-17 13:27:32,013: INFO - instal·lant mautrix_telegram...
2022-09-17 13:27:32,086: DEBUG - Nothing to update in LDAP
2022-09-17 13:27:32,087: DEBUG - S'ha actualitzat el permís «mautrix_telegram.main»
2022-09-17 13:27:32,134: DEBUG - El registre complet d'aquesta operació: «<a href="#/tools/logs/20220917-112732-permission_url-mautrix_telegram" style="text-decoration:underline">Actualització de la URL associada al permís «mautrix_telegram»</a>»
2022-09-17 13:27:32,319: DEBUG - The permission database has been resynchronized
2022-09-17 13:27:32,388: DEBUG - S'ha regenerat la configuració SSOwat
2022-09-17 13:27:32,439: DEBUG - S'ha creat el permís «mautrix_telegram.main»
2022-09-17 13:27:32,439: DEBUG - El registre complet d'aquesta operació: «<a href="#/tools/logs/20220917-112732-permission_create-mautrix_telegram" style="text-decoration:underline">Crear el permís «mautrix_telegram»</a>»
2022-09-17 13:27:32,447: DEBUG - Executing command '['sh', '-c', '/bin/bash -x "./install"  7>&1']'
2022-09-17 13:27:32,452: DEBUG - + source _common.sh
2022-09-17 13:27:32,452: DEBUG - ++ pkg_dependencies='postgresql python3 zlib1g-dev libjpeg-dev libwebp-dev python3-venv libpq-dev libffi-dev'
2022-09-17 13:27:32,452: DEBUG - ++ pkg_dependencies_e2be=libolm-dev
2022-09-17 13:27:32,452: DEBUG - + source /usr/share/yunohost/helpers
2022-09-17 13:27:32,452: DEBUG - +++ set +o
2022-09-17 13:27:32,453: DEBUG - +++ grep xtrace
2022-09-17 13:27:32,453: DEBUG - ++ readonly 'XTRACE_ENABLE=set -o xtrace'
2022-09-17 13:27:32,453: DEBUG - ++ XTRACE_ENABLE='set -o xtrace'
2022-09-17 13:27:32,462: DEBUG - + ynh_abort_if_errors
2022-09-17 13:27:32,463: DEBUG - + trap ynh_exit_properly EXIT
2022-09-17 13:27:32,463: DEBUG - + synapsenumber=1
2022-09-17 13:27:32,463: DEBUG - + botname=telegrambot
2022-09-17 13:27:32,463: DEBUG - + encryption=1
2022-09-17 13:27:32,463: DEBUG - + botadmin=@marc:domain2.tld
2022-09-17 13:27:32,463: DEBUG - + botusers=local
2022-09-17 13:27:32,463: DEBUG - + apiid=XXXX
2022-09-17 13:27:32,463: DEBUG - + apihash=XXXX
2022-09-17 13:27:32,463: DEBUG - + bottoken=**********
2022-09-17 13:27:32,463: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:32,463: DEBUG - + synapse_instance=synapse
2022-09-17 13:27:32,463: DEBUG - ++ ynh_app_setting_get --app synapse --key server_name
2022-09-17 13:27:32,464: DEBUG - ++ local _globalapp=mautrix_telegram
2022-09-17 13:27:32,491: DEBUG - ++ app=synapse
2022-09-17 13:27:32,491: DEBUG - ++ [[ server_name =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:32,491: DEBUG - ++ ynh_app_setting get synapse server_name
2022-09-17 13:27:32,523: DEBUG - + server_name=domain2.tld
2022-09-17 13:27:32,523: DEBUG - ++ ynh_app_setting_get --app synapse --key domain
2022-09-17 13:27:32,523: DEBUG - ++ local _globalapp=mautrix_telegram
2022-09-17 13:27:32,552: DEBUG - ++ app=synapse
2022-09-17 13:27:32,552: DEBUG - ++ [[ domain =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:32,553: DEBUG - ++ ynh_app_setting get synapse domain
2022-09-17 13:27:32,584: DEBUG - + domain=matrix.domain2.tld
2022-09-17 13:27:32,584: DEBUG - + synapse_config_path=/etc/matrix-synapse
2022-09-17 13:27:32,584: DEBUG - + app_service_registration_path=/etc/matrix-synapse/app-service
2022-09-17 13:27:32,585: DEBUG - + synapse_name=matrix-synapse
2022-09-17 13:27:32,585: DEBUG - + synapse_user=matrix-synapse
2022-09-17 13:27:32,585: DEBUG - + synapse_db_name=matrix_synapse
2022-09-17 13:27:32,585: DEBUG - + synapse_db_user=matrix_synapse
2022-09-17 13:27:32,585: DEBUG - + mautrix_bridge_user=mautrix_telegram
2022-09-17 13:27:32,585: DEBUG - + mautrix_bridge_db_name=mautrix_telegram
2022-09-17 13:27:32,585: DEBUG - + mautrix_bridge_db_user=mautrix_telegram
2022-09-17 13:27:32,585: DEBUG - ++ ynh_app_upstream_version
2022-09-17 13:27:32,585: DEBUG - ++ manifest=
2022-09-17 13:27:32,585: DEBUG - ++ [[ '' != '' ]]
2022-09-17 13:27:32,585: DEBUG - ++ version_key_=0.11.3~ynh2
2022-09-17 13:27:32,586: DEBUG - ++ echo 0.11.3
2022-09-17 13:27:32,586: DEBUG - + upstream_version=0.11.3
2022-09-17 13:27:32,632: INFO - [....................] > Validating installation parameters...
2022-09-17 13:27:32,633: DEBUG - + final_path=/opt/yunohost/mautrix_telegram
2022-09-17 13:27:32,633: DEBUG - + test '!' -e /opt/yunohost/mautrix_telegram
2022-09-17 13:27:32,671: INFO - [+...................] > Storing installation settings...
2022-09-17 13:27:32,671: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=domain --value=matrix.domain2.tld
2022-09-17 13:27:32,671: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:32,705: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:32,705: DEBUG - + [[ domain =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:32,705: DEBUG - + ynh_app_setting set mautrix_telegram domain matrix.domain2.tld
2022-09-17 13:27:32,736: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=server_name --value=domain2.tld
2022-09-17 13:27:32,736: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:32,771: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:32,771: DEBUG - + [[ server_name =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:32,772: DEBUG - + ynh_app_setting set mautrix_telegram server_name domain2.tld
2022-09-17 13:27:32,800: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=botname --value=telegrambot
2022-09-17 13:27:32,800: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:32,836: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:32,836: DEBUG - + [[ botname =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:32,836: DEBUG - + ynh_app_setting set mautrix_telegram botname telegrambot
2022-09-17 13:27:32,865: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=synapse_instance --value=synapse
2022-09-17 13:27:32,866: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:32,901: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:32,902: DEBUG - + [[ synapse_instance =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:32,902: DEBUG - + ynh_app_setting set mautrix_telegram synapse_instance synapse
2022-09-17 13:27:32,931: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=app_service_registration_path --value=/etc/matrix-synapse/app-service
2022-09-17 13:27:32,931: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:32,967: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:32,967: DEBUG - + [[ app_service_registration_path =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:32,967: DEBUG - + ynh_app_setting set mautrix_telegram app_service_registration_path /etc/matrix-synapse/app-service
2022-09-17 13:27:32,996: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=encryption --value=1
2022-09-17 13:27:32,996: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,032: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,032: DEBUG - + [[ encryption =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,032: DEBUG - + ynh_app_setting set mautrix_telegram encryption 1
2022-09-17 13:27:33,061: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=mautrix_bridge_db_name --value=mautrix_telegram
2022-09-17 13:27:33,061: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,097: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,097: DEBUG - + [[ mautrix_bridge_db_name =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,098: DEBUG - + ynh_app_setting set mautrix_telegram mautrix_bridge_db_name mautrix_telegram
2022-09-17 13:27:33,127: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=botadmin --value=@marc:domain2.tld
2022-09-17 13:27:33,127: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,163: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,163: DEBUG - + [[ botadmin =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,164: DEBUG - + ynh_app_setting set mautrix_telegram botadmin @marc:domain2.tld
2022-09-17 13:27:33,193: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=botusers --value=local
2022-09-17 13:27:33,193: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,230: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,230: DEBUG - + [[ botusers =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,230: DEBUG - + ynh_app_setting set mautrix_telegram botusers local
2022-09-17 13:27:33,259: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=apiid --value=XXXX
2022-09-17 13:27:33,259: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,297: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,297: DEBUG - + [[ apiid =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,297: DEBUG - + ynh_app_setting set mautrix_telegram apiid XXXX
2022-09-17 13:27:33,334: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=apihash --value=XXXX
2022-09-17 13:27:33,335: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,371: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,371: DEBUG - + [[ apihash =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,371: DEBUG - + ynh_app_setting set mautrix_telegram apihash XXXX
2022-09-17 13:27:33,401: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=bottoken --value=**********
2022-09-17 13:27:33,402: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,438: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,438: DEBUG - + [[ bottoken =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,438: DEBUG - + ynh_app_setting set mautrix_telegram bottoken **********
2022-09-17 13:27:33,468: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=mautrix_version --value=0.11.3
2022-09-17 13:27:33,468: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,504: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,504: DEBUG - + [[ mautrix_version =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,504: DEBUG - + ynh_app_setting set mautrix_telegram mautrix_version 0.11.3
2022-09-17 13:27:33,534: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=final_path --value=/opt/yunohost/mautrix_telegram
2022-09-17 13:27:33,534: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,570: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,570: DEBUG - + [[ final_path =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,570: DEBUG - + ynh_app_setting set mautrix_telegram final_path /opt/yunohost/mautrix_telegram
2022-09-17 13:27:33,642: INFO - [#...................] > Finding an available port...
2022-09-17 13:27:33,643: DEBUG - ++ ynh_find_port --port=29317
2022-09-17 13:27:33,648: DEBUG - ++ test -n 29317
2022-09-17 13:27:33,648: DEBUG - ++ ynh_port_available --port=29317
2022-09-17 13:27:33,654: DEBUG - ++ ss --numeric --listening --tcp --udp
2022-09-17 13:27:33,654: DEBUG - ++ awk '{print$5}'
2022-09-17 13:27:33,654: DEBUG - ++ grep --quiet --extended-regexp ':29317$'
2022-09-17 13:27:33,658: DEBUG - ++ grep -q 'port: '\''29317'\''' /etc/yunohost/apps/borg/settings.yml /etc/yunohost/apps/element/settings.yml /etc/yunohost/apps/gitea/settings.yml /etc/yunohost/apps/mautrix_telegram/settings.yml /etc/yunohost/apps/mautrix_whatsapp/settings.yml /etc/yunohost/apps/netdata/settings.yml /etc/yunohost/apps/nitter/settings.yml /etc/yunohost/apps/rspamdui/settings.yml /etc/yunohost/apps/synapse/settings.yml /etc/yunohost/apps/syncthing/settings.yml /etc/yunohost/apps/wallabag2/settings.yml
2022-09-17 13:27:33,659: DEBUG - ++ return 0
2022-09-17 13:27:33,659: DEBUG - ++ echo 29317
2022-09-17 13:27:33,660: DEBUG - + port=29317
2022-09-17 13:27:33,660: DEBUG - + ynh_app_setting_set --app=mautrix_telegram --key=port --value=29317
2022-09-17 13:27:33,660: DEBUG - + local _globalapp=mautrix_telegram
2022-09-17 13:27:33,696: DEBUG - + app=mautrix_telegram
2022-09-17 13:27:33,696: DEBUG - + [[ port =~ (unprotected|protected|skipped)_ ]]
2022-09-17 13:27:33,696: DEBUG - + ynh_app_setting set mautrix_telegram port 29317
2022-09-17 13:27:33,768: INFO - [#++++++++++++++.....] > Installing dependencies...
2022-09-17 13:27:33,768: DEBUG - + ynh_install_extra_app_dependencies libolm-dev
2022-09-17 13:27:33,786: DEBUG - + name=mautrix_telegram
2022-09-17 13:27:33,786: DEBUG - + key=
2022-09-17 13:27:33,786: DEBUG - + '[' -n '' ']'
2022-09-17 13:27:33,786: DEBUG - + ynh_install_extra_repo --repo=libolm-dev --priority=995 --name=mautrix_telegram
2022-09-17 13:27:33,842: DEBUG - + name=mautrix_telegram
2022-09-17 13:27:33,842: DEBUG - + append=0
2022-09-17 13:27:33,842: DEBUG - + key=
2022-09-17 13:27:33,842: DEBUG - + priority=995
2022-09-17 13:27:33,842: DEBUG - + append=
2022-09-17 13:27:33,842: DEBUG - + wget_append=tee
2022-09-17 13:27:33,843: DEBUG - + repo=libolm-dev
2022-09-17 13:27:33,843: DEBUG - ++ echo libolm-dev
2022-09-17 13:27:33,843: DEBUG - ++ awk '{ print $1 }'
2022-09-17 13:27:33,844: DEBUG - + local uri=libolm-dev
2022-09-17 13:27:33,845: DEBUG - ++ echo libolm-dev
2022-09-17 13:27:33,845: DEBUG - ++ awk '{ print $2 }'
2022-09-17 13:27:33,846: DEBUG - + local suite=
2022-09-17 13:27:33,847: DEBUG - + local component=libolm-dev
2022-09-17 13:27:33,847: DEBUG - + ynh_add_repo --uri=libolm-dev --suite= --component=libolm-dev --name=mautrix_telegram
2022-09-17 13:27:33,932: DEBUG - + name=mautrix_telegram
2022-09-17 13:27:33,932: DEBUG - + append=0
2022-09-17 13:27:33,932: DEBUG - + append=tee
2022-09-17 13:27:33,932: DEBUG - + mkdir --parents /etc/apt/sources.list.d
2022-09-17 13:27:33,933: DEBUG - + tee /etc/apt/sources.list.d/mautrix_telegram.list
2022-09-17 13:27:33,934: DEBUG - deb libolm-dev  libolm-dev
2022-09-17 13:27:33,934: DEBUG - + local pin=libolm-dev
2022-09-17 13:27:33,934: DEBUG - + pin=libolm-dev
2022-09-17 13:27:33,934: DEBUG - + '[' -n 995 ']'
2022-09-17 13:27:33,934: DEBUG - + priority=--priority=995
2022-09-17 13:27:33,934: DEBUG - + ynh_pin_repo '--package=*' '--pin=origin "libolm-dev"' --priority=995 --name=mautrix_telegram
2022-09-17 13:27:34,021: DEBUG - + package='*'
2022-09-17 13:27:34,021: DEBUG - + priority=995
2022-09-17 13:27:34,021: DEBUG - + name=mautrix_telegram
2022-09-17 13:27:34,021: DEBUG - + append=0
2022-09-17 13:27:34,022: DEBUG - + append=tee
2022-09-17 13:27:34,022: DEBUG - + [[ mautrix_telegram != \e\x\t\r\a\_\p\h\p\_\v\e\r\s\i\o\n ]]
2022-09-17 13:27:34,022: DEBUG - + mkdir --parents /etc/apt/preferences.d
2022-09-17 13:27:34,023: DEBUG - Pin: origin "libolm-dev"
2022-09-17 13:27:34,023: DEBUG - Pin-Priority: 995
2022-09-17 13:27:34,023: DEBUG - '
2022-09-17 13:27:34,023: DEBUG - + tee /etc/apt/preferences.d/mautrix_telegram
2022-09-17 13:27:34,023: DEBUG - Package: *
2022-09-17 13:27:34,023: DEBUG - Pin: origin "libolm-dev"
2022-09-17 13:27:34,024: DEBUG - Pin-Priority: 995
2022-09-17 13:27:34,024: DEBUG - 
2022-09-17 13:27:34,024: DEBUG - + '[' -n '' ']'
2022-09-17 13:27:34,024: DEBUG - + ynh_package_update
2022-09-17 13:27:34,024: DEBUG - + ynh_apt update
2022-09-17 13:27:34,024: DEBUG - + ynh_wait_dpkg_free
2022-09-17 13:27:34,142: DEBUG - + return 0
2022-09-17 13:27:34,143: DEBUG - + LC_ALL=C
2022-09-17 13:27:34,143: DEBUG - + DEBIAN_FRONTEND=noninteractive
2022-09-17 13:27:34,143: DEBUG - + apt-get --assume-yes --quiet -o=Acquire::Retries=3 -o=Dpkg::Use-Pty=0 update
2022-09-17 13:27:34,160: WARNING - E: Malformed entry 1 in list file /etc/apt/sources.list.d/mautrix_telegram.list (URI parse)
2022-09-17 13:27:34,161: WARNING - E: The list of sources could not be read.
2022-09-17 13:27:34,161: DEBUG - + ynh_exit_properly
2022-09-17 13:27:34,161: DEBUG - + local exit_code=100
2022-09-17 13:27:34,162: DEBUG - + '[' 100 -eq 0 ']'
2022-09-17 13:27:34,664: DEBUG - + ynh_clean_setup
2022-09-17 13:27:34,664: DEBUG - + ynh_clean_check_starting
2022-09-17 13:27:34,665: DEBUG - + '[' -n '' ']'
2022-09-17 13:27:34,665: DEBUG - + '[' -n '' ']'
2022-09-17 13:27:35,667: ERROR - No s'ha pogut instal·lar mautrix_telegram: Hi ha hagut un error en el script d'instal·lació de l'aplicació
thardev commented 1 year ago

Hi @marcoil :)

I've experienced that as well, with current master branch it could happen. I fixed it in the latest update, so when I merge this PR #29 it should be fixed on master.

For now as a workaround you could try to install from testing as follows: sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_telegram_ynh/tree/testing Hope it helps :)

marcoil commented 1 year ago

Thanks for the fast response! I ended up installing it without encryption, I'll try again with the next version.

thardev commented 1 year ago

Hi @marcoil :) Next version is there. Could you try when you have some time and see if it works now? Thanks!

marcoil commented 1 year ago

I tried to update to the newest version and something went wrong, so I re-installed. The first time I got an error about the mautrix-telegram user already being present, but on a second try everything went correctly.

It did create new rooms for everything, which I suppose it's expected.

Thanks a lot!