deltachat / mailadm

mail account administration tool for temporary and other account creation/modification
https://mailadm.readthedocs.io/
Mozilla Public License 2.0
14 stars 1 forks source link

also ignore if chat ID is there but message can't be sent #114

Closed missytake closed 1 year ago

missytake commented 1 year ago

This error appears if you migrated the mailadm database, didn't migrate the adminbot database, and ran mailadm setup-bot:

Waiting until you join the chat
Welcome message sent.
Traceback (most recent call last):
  File "/usr/bin/mailadm", line 8, in <module>
    sys.exit(mailadm_main())
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/mailadm/cmdline.py", line 171, in setup_bot
    oldgroup.send_text(
  File "/usr/lib/python3.10/site-packages/deltachat/chat.py", line 311, in send_text
    raise ValueError("message could not be send, does chat exist?")
ValueError: message could not be send, does chat exist?

This PR fixes this crash by ignoring the error. A similar error was already escaped in exact this location, this just spits out a different error message we didn't catch yet.

link2xt commented 1 year ago

This error appears if you migrated the mailadm database, didn't migrate the adminbot database

How does one migrate a database? What does it mean in this context? Is it about migrating from a pre-mailcow setup, moving from one server to another or something else?

missytake commented 1 year ago

This error appears if you migrated the mailadm database, didn't migrate the adminbot database

How does one migrate a database? What does it mean in this context? Is it about migrating from a pre-mailcow setup, moving from one server to another or something else?

no, something else - just copying the mailadm database to a new server, without also copying the adminbot database.

missytake commented 1 year ago

GitHub CI is red due to dc.develcow.de being broken again - tox is happy if you run it with testrun.org as mailcow instance.