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

[Bug] Mirage stuck on loading screen #268

Open
proudmuslim-dev opened this issue Oct 22, 2021 · 24 comments
Open

[Bug] Mirage stuck on loading screen #268

proudmuslim-dev opened this issue Oct 22, 2021 · 24 comments
Labels
bug Something isn't working

Comments

@proudmuslim-dev
Copy link

Description

Describe your issue in details, provide error logs or screenshots if possible.

Your environment

  • OS: Arch Linux
  • WM: Swaym
  • How did you install Mirage? matrix-mirage-git AUR package

Steps to reproduce

  1. Open Mirage

Expected behavior

Mirage should open as intended

Actual behavior

Mirage is stuck on the loading screen

Log

~ 19:17:05 | Got library name:  "/usr/lib/qt/qml/io/thp/pyotherside/libpyothersideplugin.so"
~ 19:17:05 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"qrc:/src/backend/qml_bridge.py\", line 28, in <module>\n    from .pyotherside_events import CoroutineDone, LoopException\n\n  File \"qrc:/src/backend/pyotherside_events.py\", line 10, in <module>\n    from .utils import serialize_value_for_qml\n\n  File \"qrc:/src/backend/utils.py\", line 32, in <module>\n    from nio.crypto import AsyncDataT as File\n\n  File \"/usr/lib/python3.9/site-packages/nio/__init__.py\", line 2, in <module>\n    from .client import *\n\n  File \"/usr/lib/python3.9/site-packages/nio/client/__init__.py\", line 3, in <module>\n    from .base_client import Client, ClientConfig\n\n  File \"/usr/lib/python3.9/site-packages/nio/client/base_client.py\", line 35, in <module>\n    from ..crypto import ENCRYPTION_ENABLED\n\n  File \"/usr/lib/python3.9/site-packages/nio/crypto/__init__.py\", line 23, in <module>\n    from .sessions import (\n\n  File \"/usr/lib/python3.9/site-packages/nio/crypto/sessions.py\", line 23, in <module>\n    import olm\n\n  File \"/usr/lib/python3.9/site-packages/olm/__init__.py\", line 24, in <module>\n    from .utility import ed25519_verify, OlmVerifyError, OlmHashError, sha256\n\n  File \"/usr/lib/python3.9/site-packages/olm/utility.py\", line 39, in <module>\n    from _libolm import ffi, lib  # type: ignore\n\nImportError: libffi.so.7: cannot open shared object file: No such file or directory\n"
! 19:17:05 | Unhandled PyOtherSide error: Cannot import module: backend.qml_bridge (Traceback (most recent call last):

  File "qrc:/src/backend/qml_bridge.py", line 28, in <module>
    from .pyotherside_events import CoroutineDone, LoopException

  File "qrc:/src/backend/pyotherside_events.py", line 10, in <module>
    from .utils import serialize_value_for_qml

  File "qrc:/src/backend/utils.py", line 32, in <module>
    from nio.crypto import AsyncDataT as File

  File "/usr/lib/python3.9/site-packages/nio/__init__.py", line 2, in <module>
    from .client import *

  File "/usr/lib/python3.9/site-packages/nio/client/__init__.py", line 3, in <module>
    from .base_client import Client, ClientConfig

  File "/usr/lib/python3.9/site-packages/nio/client/base_client.py", line 35, in <module>
    from ..crypto import ENCRYPTION_ENABLED

  File "/usr/lib/python3.9/site-packages/nio/crypto/__init__.py", line 23, in <module>
    from .sessions import (

  File "/usr/lib/python3.9/site-packages/nio/crypto/sessions.py", line 23, in <module>
    import olm

  File "/usr/lib/python3.9/site-packages/olm/__init__.py", line 24, in <module>
    from .utility import ed25519_verify, OlmVerifyError, OlmHashError, sha256

  File "/usr/lib/python3.9/site-packages/olm/utility.py", line 39, in <module>
    from _libolm import ffi, lib  # type: ignore

ImportError: libffi.so.7: cannot open shared object file: No such file or directory
)
~ 19:17:05 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'BRIDGE' is not defined\n"
! 19:17:05 | Unhandled PyOtherSide error: Function not found: 'BRIDGE.call_backend_coro' (Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'BRIDGE' is not defined
)

I attempted to install libffi from source, and the issue persisted.

@proudmuslim-dev proudmuslim-dev added the bug Something isn't working label Oct 22, 2021
@DrRac27
Copy link

DrRac27 commented Oct 22, 2021

Seems like a rebuild of mirage is needed. If that fixes it for you please report it to the maintainer of the AUR package so they can increase the pkgrel

@DrRac27
Copy link

DrRac27 commented Oct 22, 2021

I just did a pacman -Syu, libffi got upgraded and mirage still runs fine. So the problem should not be related to mirage. Did you do something like a partial update (which is not allowed on Arch)? A full system update might fix the problem for you

@proudmuslim-dev
Copy link
Author

I've already attempted to rebuild Mirage, did it again just now and the error is persisting

@jonassmedegaard
Copy link

@proudmuslim-dev I think you are missing the point in latest post by @DrRac27: Some dependency of Mirage (not Mirage itself) might need recompiling.

@zapashcanon
Copy link

I have the same error on debian, building from source or with the official package:

From source:

~ 18:20:27 | Got library name:  "/usr/lib/x86_64-linux-gnu/qt5/qml/io/thp/pyotherside/libpyothersideplugin.so"
~ 18:20:28 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"/home/zapashcanon/dev/py/mirage/src/backend/qml_bridge.py\", line 28, in <module>\n    from .pyotherside_events import CoroutineDone, LoopException\n\n  File \"/home/zapashcanon/dev/py/mirage/src/backend/pyotherside_events.py\", line 10, in <module>\n    from .utils import serialize_value_for_qml\n\n  File \"/home/zapashcanon/dev/py/mirage/src/backend/utils.py\", line 32, in <module>\n    from nio.crypto import AsyncDataT as File\n\n  File \"/home/zapashcanon/.local/lib/python3.9/site-packages/nio/__init__.py\", line 2, in <module>\n    from .client import *\n\n  File \"/home/zapashcanon/.local/lib/python3.9/site-packages/nio/client/__init__.py\", line 6, in <module>\n    from .async_client import AsyncClient, AsyncClientConfig, DataProvider\n\n  File \"/home/zapashcanon/.local/lib/python3.9/site-packages/nio/client/async_client.py\", line 47, in <module>\n    from aiohttp import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/__init__.py\", line 6, in <module>\n    from .client import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/client.py\", line 35, in <module>\n    from . import hdrs, http, payload\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/http.py\", line 7, in <module>\n    from .http_parser import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/http_parser.py\", line 15, in <module>\n    from .helpers import NO_EXTENSIONS, BaseTimerContext\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/helpers.py\", line 667, in <module>\n    class CeilTimeout(async_timeout.timeout):\n\nTypeError: function() argument 'code' must be code, not str\n"
! 18:20:28 | Unhandled PyOtherSide error: Cannot import module: backend.qml_bridge (Traceback (most recent call last):

  File "/home/zapashcanon/dev/py/mirage/src/backend/qml_bridge.py", line 28, in <module>
    from .pyotherside_events import CoroutineDone, LoopException

  File "/home/zapashcanon/dev/py/mirage/src/backend/pyotherside_events.py", line 10, in <module>
    from .utils import serialize_value_for_qml

  File "/home/zapashcanon/dev/py/mirage/src/backend/utils.py", line 32, in <module>
    from nio.crypto import AsyncDataT as File

  File "/home/zapashcanon/.local/lib/python3.9/site-packages/nio/__init__.py", line 2, in <module>
    from .client import *

  File "/home/zapashcanon/.local/lib/python3.9/site-packages/nio/client/__init__.py", line 6, in <module>
    from .async_client import AsyncClient, AsyncClientConfig, DataProvider

  File "/home/zapashcanon/.local/lib/python3.9/site-packages/nio/client/async_client.py", line 47, in <module>
    from aiohttp import (

  File "/usr/lib/python3/dist-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import (

  File "/usr/lib/python3/dist-packages/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload

  File "/usr/lib/python3/dist-packages/aiohttp/http.py", line 7, in <module>
    from .http_parser import (

  File "/usr/lib/python3/dist-packages/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext

  File "/usr/lib/python3/dist-packages/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):

TypeError: function() argument 'code' must be code, not str
)
~ 18:20:28 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'BRIDGE' is not defined\n"
! 18:20:28 | Unhandled PyOtherSide error: Function not found: 'BRIDGE.call_backend_coro' (Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'BRIDGE' is not defined

Official package:

matrix-mirage
~ 18:21:35 | Got library name:  "/usr/lib/x86_64-linux-gnu/qt5/qml/io/thp/pyotherside/libpyothersideplugin.so"
~ 18:21:36 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"qrc:/src/backend/qml_bridge.py\", line 28, in <module>\n    from .pyotherside_events import CoroutineDone, LoopException\n\n  File \"qrc:/src/backend/pyotherside_events.py\", line 10, in <module>\n    from .utils import serialize_value_for_qml\n\n  File \"qrc:/src/backend/utils.py\", line 32, in <module>\n    from nio.crypto import AsyncDataT as File\n\n  File \"/home/zapashcanon/.local/lib/python3.9/site-packages/nio/__init__.py\", line 2, in <module>\n    from .client import *\n\n  File \"/home/zapashcanon/.local/lib/python3.9/site-packages/nio/client/__init__.py\", line 6, in <module>\n    from .async_client import AsyncClient, AsyncClientConfig, DataProvider\n\n  File \"/home/zapashcanon/.local/lib/python3.9/site-packages/nio/client/async_client.py\", line 47, in <module>\n    from aiohttp import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/__init__.py\", line 6, in <module>\n    from .client import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/client.py\", line 35, in <module>\n    from . import hdrs, http, payload\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/http.py\", line 7, in <module>\n    from .http_parser import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/http_parser.py\", line 15, in <module>\n    from .helpers import NO_EXTENSIONS, BaseTimerContext\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/helpers.py\", line 667, in <module>\n    class CeilTimeout(async_timeout.timeout):\n\nTypeError: function() argument 'code' must be code, not str\n"
! 18:21:36 | Unhandled PyOtherSide error: Cannot import module: backend.qml_bridge (Traceback (most recent call last):

  File "qrc:/src/backend/qml_bridge.py", line 28, in <module>
    from .pyotherside_events import CoroutineDone, LoopException

  File "qrc:/src/backend/pyotherside_events.py", line 10, in <module>
    from .utils import serialize_value_for_qml

  File "qrc:/src/backend/utils.py", line 32, in <module>
    from nio.crypto import AsyncDataT as File

  File "/home/zapashcanon/.local/lib/python3.9/site-packages/nio/__init__.py", line 2, in <module>
    from .client import *

  File "/home/zapashcanon/.local/lib/python3.9/site-packages/nio/client/__init__.py", line 6, in <module>
    from .async_client import AsyncClient, AsyncClientConfig, DataProvider

  File "/home/zapashcanon/.local/lib/python3.9/site-packages/nio/client/async_client.py", line 47, in <module>
    from aiohttp import (

  File "/usr/lib/python3/dist-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import (

  File "/usr/lib/python3/dist-packages/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload

  File "/usr/lib/python3/dist-packages/aiohttp/http.py", line 7, in <module>
    from .http_parser import (

  File "/usr/lib/python3/dist-packages/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext

  File "/usr/lib/python3/dist-packages/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):

TypeError: function() argument 'code' must be code, not str
)
~ 18:21:36 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'BRIDGE' is not defined\n"
! 18:21:36 | Unhandled PyOtherSide error: Function not found: 'BRIDGE.call_backend_coro' (Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'BRIDGE' is not defined

@jonassmedegaard
Copy link

I have the same error on debian, building from source or with the official package:

Probably helpful if you can share if you mean Debian stable (bullseye), testing (bookworm), or unstable (sid), and which exact version of the official package.

@jonassmedegaard
Copy link

Also (depending on what exactly you are doing) it might help to ensure all build-dependencies for the package is installed - e.g. using apt build-dep matrix-mirage.

@zapashcanon
Copy link

I'm on debian unstable, version 0.7.2~dfsg+~hsluv1.0.0+~1.0.0-3

@jonassmedegaard
Copy link

@zapashcanon did you see my follow-up post?

@zapashcanon
Copy link

Sorry.

After installing build deps, I keep having the exact same error with both methods (mirage package from Debian and mirage built from source). (And I don't see why it would have changed something ?)

@jonassmedegaard
Copy link

If some libraries were missing then that would affect the build - I am not sure how such failure would look like, so I simply suggested to make sure it was all there.

It seems your build uses a mixture of system-provided libraries and libraries below /home/zapashcanon/.local/lib/python3.9/site-packages/ - perhaps those local libraries are incompatible? and cause the build failure?

@zapashcanon
Copy link

zapashcanon commented Nov 29, 2021

There's no build failure, it's a runtime error: it fails when I start mirage. If I delete everything in ~/.local/lib/python3.9 and use mirage from the debian package, it fails in the same way:

rm -rf ~/.local/lib/python3.9
matrix-mirage
~ 13:42:52 | Got library name:  "/usr/lib/x86_64-linux-gnu/qt5/qml/io/thp/pyotherside/libpyothersideplugin.so"
~ 13:42:53 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"qrc:/src/backend/qml_bridge.py\", line 28, in <module>\n    from .pyotherside_events import CoroutineDone, LoopException\n\n  File \"qrc:/src/backend/pyotherside_events.py\", line 10, in <module>\n    from .utils import serialize_value_for_qml\n\n  File \"qrc:/src/backend/utils.py\", line 32, in <module>\n    from nio.crypto import AsyncDataT as File\n\n  File \"/usr/lib/python3/dist-packages/nio/__init__.py\", line 2, in <module>\n    from .client import *\n\n  File \"/usr/lib/python3/dist-packages/nio/client/__init__.py\", line 6, in <module>\n    from .async_client import AsyncClient, AsyncClientConfig, DataProvider\n\n  File \"/usr/lib/python3/dist-packages/nio/client/async_client.py\", line 47, in <module>\n    from aiohttp import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/__init__.py\", line 6, in <module>\n    from .client import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/client.py\", line 35, in <module>\n    from . import hdrs, http, payload\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/http.py\", line 7, in <module>\n    from .http_parser import (\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/http_parser.py\", line 15, in <module>\n    from .helpers import NO_EXTENSIONS, BaseTimerContext\n\n  File \"/usr/lib/python3/dist-packages/aiohttp/helpers.py\", line 667, in <module>\n    class CeilTimeout(async_timeout.timeout):\n\nTypeError: function() argument 'code' must be code, not str\n"
! 13:42:53 | Unhandled PyOtherSide error: Cannot import module: backend.qml_bridge (Traceback (most recent call last):

  File "qrc:/src/backend/qml_bridge.py", line 28, in <module>
    from .pyotherside_events import CoroutineDone, LoopException

  File "qrc:/src/backend/pyotherside_events.py", line 10, in <module>
    from .utils import serialize_value_for_qml

  File "qrc:/src/backend/utils.py", line 32, in <module>
    from nio.crypto import AsyncDataT as File

  File "/usr/lib/python3/dist-packages/nio/__init__.py", line 2, in <module>
    from .client import *

  File "/usr/lib/python3/dist-packages/nio/client/__init__.py", line 6, in <module>
    from .async_client import AsyncClient, AsyncClientConfig, DataProvider

  File "/usr/lib/python3/dist-packages/nio/client/async_client.py", line 47, in <module>
    from aiohttp import (

  File "/usr/lib/python3/dist-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import (

  File "/usr/lib/python3/dist-packages/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload

  File "/usr/lib/python3/dist-packages/aiohttp/http.py", line 7, in <module>
    from .http_parser import (

  File "/usr/lib/python3/dist-packages/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext

  File "/usr/lib/python3/dist-packages/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):

TypeError: function() argument 'code' must be code, not str
)
~ 13:42:53 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'BRIDGE' is not defined\n"
! 13:42:53 | Unhandled PyOtherSide error: Function not found: 'BRIDGE.call_backend_coro' (Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'BRIDGE' is not defined
)

@jonassmedegaard
Copy link

Ah, I misunderstood the nature of the issue. My points remain, though - the mixture og Qt and Python means that some of the same kinds of issues may occur either at build time or at runtime.

Sorry, I cannot help more here.

If this issue occurs using no custom-downloaded or custom-built code, only using the official Debian package, then please report that as an issue in Debian using the command-line tool reportbug.

@zapashcanon
Copy link

As I said, the same issue arise when using only the official debian package, see my last paste which makes no mention of ~/.local/lib/python3.9, but as it happens too with mirage built from source, I believe it comes from mirage (or one of its dependency).

@jonassmedegaard
Copy link

You don't need to report it with Debian if you don't want to.

I use the Debian package (and maintain it as well) and I cannot reproduce the issue reported here. In case that's any help to you and/or to the upstream developers.

@zapashcanon
Copy link

I don't understand why but, upgrading to the latest debian package (0.7.2~dfsg+~hsluv1.0.0+~1.0.0-4) fixed the issue...

@zapashcanon
Copy link

The issue came back and persists since a month. :/

@MRAAGH
Copy link
Contributor

MRAAGH commented Jan 10, 2022

Is the error the same?

@zapashcanon
Copy link

The second half of it yes :

$ matrix-mirage
~ 15:26:33 | Got library name:  "/usr/lib/x86_64-linux-gnu/qt5/qml/io/thp/pyotherside/libpyothersideplugin.so"
~ 15:26:34 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"qrc:/src/backend/qml_bridge.py\", line 181, in <module>\n    BRIDGE = QMLBridge()\n\n  File \"qrc:/src/backend/qml_bridge.py\", line 52, in __init__\n    from .backend import Backend\n\n  File \"qrc:/src/backend/backend.py\", line 24, in <module>\n    from .matrix_client import MatrixClient\n\n  File \"qrc:/src/backend/matrix_client.py\", line 42, in <module>\n    from .html_markdown import HTML_PROCESSOR as HTML\n\n  File \"qrc:/src/backend/html_markdown.py\", line 21, in <module>\n    class MarkdownInlineGrammar(mistune.InlineGrammar):\n\nAttributeError: module 'mistune' has no attribute 'InlineGrammar'\n"
! 15:26:34 | Unhandled PyOtherSide error: Cannot import module: backend.qml_bridge (Traceback (most recent call last):

  File "qrc:/src/backend/qml_bridge.py", line 181, in <module>
    BRIDGE = QMLBridge()

  File "qrc:/src/backend/qml_bridge.py", line 52, in __init__
    from .backend import Backend

  File "qrc:/src/backend/backend.py", line 24, in <module>
    from .matrix_client import MatrixClient

  File "qrc:/src/backend/matrix_client.py", line 42, in <module>
    from .html_markdown import HTML_PROCESSOR as HTML

  File "qrc:/src/backend/html_markdown.py", line 21, in <module>
    class MarkdownInlineGrammar(mistune.InlineGrammar):

AttributeError: module 'mistune' has no attribute 'InlineGrammar'
)
~ 15:26:34 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'BRIDGE' is not defined\n"
! 15:26:34 | Unhandled PyOtherSide error: Function not found: 'BRIDGE.call_backend_coro' (Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'BRIDGE' is not defined
\\\

@MRAAGH
Copy link
Contributor

MRAAGH commented Jan 10, 2022

You have the wrong version of mistune. Try uninstalling the mistune python package and installing version 0.8.4-4.
On Debian, you can get it with apt install python3-mistune

@zapashcanon
Copy link

I have the python3-mistune from debian already, so maybe it's a problem with the debian packaging @jonassmedegaard ?

But anyway, it's stuck because of the second part:

~ 15:26:34 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'BRIDGE' is not defined\n"
! 15:26:34 | Unhandled PyOtherSide error: Function not found: 'BRIDGE.call_backend_coro' (Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'BRIDGE' is not defined

And I have no idea how to fix this. :/

@jonassmedegaard
Copy link

jonassmedegaard commented Jan 10, 2022 via email

@MRAAGH
Copy link
Contributor

MRAAGH commented Jan 10, 2022

Unhandled PyOtherSide error: Cannot import module: backend.qml_bridge

Bridge is not defined because qml_bridge was not imported because mistune has no attribute InlineGrammar because the wrong version is being used. Maybe you have multiple installations of mistune?

@zapashcanon
Copy link

@MRAAGH thanks, I believed the two errors where unrelated, thanks. No, I'm just using unstable and the bug pointed by @jonassmedegaard is the one responsible for it. Thanks. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants