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

ImportError when using this action #94

Closed
Hywan opened this issue Jul 3, 2023 · 2 comments
Closed

ImportError when using this action #94

Hywan opened this issue Jul 3, 2023 · 2 comments

Comments

@Hywan
Copy link

Hywan commented Jul 3, 2023

Hello,

We are seeing an error since a couple of days when using this action:

ImportError: cannot import name 'MissingError' from 'pydantic' (/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/pydantic/__init__.py)

The full log is the following:

Run michaelkaye/setup-matrix-synapse@main
  with:
    uploadLogs: true
    httpPort: 8228
    disableRateLimiting: true
    installer: venv
    artifactName: synapse-logs
    customConfig: {}
  env:
    CARGO_TERM_COLOR: always
    CARGO_INCREMENTAL: 0
    CACHE_ON_FAILURE: false
    pythonLocation: /opt/hostedtoolcache/Python/3.8.17/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.8.17/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.17/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.17/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.17/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.17/x64/lib
Installing synapse...
/usr/bin/mkdir -p synapse
/opt/hostedtoolcache/Python/3.8.17/x64/bin/python -m venv env
/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/bin/pip install -q --upgrade pip
/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/bin/pip install -q --upgrade setuptools
/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/bin/pip install -q matrix-synapse
Generating config...
/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/bin/python3 -m synapse.app.homeserver --server-name localhost --config-path homeserver.yaml --generate-config --report-stats=no
/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/pydantic/_internal/_config.py:257: UserWarning: Valid config keys have changed in V2:
* 'allow_mutation' has been removed
  warnings.warn(message, UserWarning)
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/app/homeserver.py", line 37, in <module>
    from synapse.app import _base
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/app/_base.py", line 68, in <module>
    from synapse.handlers.auth import load_legacy_password_auth_providers
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/handlers/auth.py", line 56, in <module>
    from synapse.api.ratelimiting import Ratelimiter
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/api/ratelimiting.py", line 21, in <module>
    from synapse.storage.databases.main import DataStore
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/storage/__init__.py", line 34, in <module>
    from synapse.storage.databases import Databases
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/storage/databases/__init__.py", line 20, in <module>
    from synapse.storage.databases.main.events import PersistEventsStore
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/storage/databases/main/__init__.py", line 27, in <module>
    from synapse.storage.databases.main.stats import UserSortOrder
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/storage/databases/main/stats.py", line 42, in <module>
    from synapse.storage.databases.main.events_worker import InvalidEventError
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/storage/databases/main/events_worker.py", line 62, in <module>
    from synapse.replication.tcp.streams import BackfillStream, UnPartialStatedEventStream
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/replication/tcp/streams/__init__.py", line 27, in <module>
    from synapse.replication.tcp.streams._base import (
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/replication/tcp/streams/_base.py", line 32, in <module>
    from synapse.replication.http.streams import ReplicationGetStreamUpdates
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/replication/http/__init__.py", line 18, in <module>
    from synapse.replication.http import (
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/replication/http/account_data.py", line 21, in <module>
    from synapse.replication.http._base import ReplicationEndpoint
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/replication/http/_base.py", line 31, in <module>
    from synapse.http.servlet import parse_json_object_from_request
  File "/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/synapse/http/servlet.py", line 32, in <module>
    from pydantic import BaseModel, MissingError, PydanticValueError, ValidationError
ImportError: cannot import name 'MissingError' from 'pydantic' (/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/lib/python3.8/site-packages/pydantic/__init__.py)
Error: The process '/home/runner/work/matrix-rust-sdk/matrix-rust-sdk/synapse/env/bin/python3' failed with exit code 1

It can be seen here, https://github.com/matrix-org/matrix-rust-sdk/actions/runs/5441737199/jobs/9896044958?pr=2195#step:7:67.

Any idea what's going wrong?

@michaelkaye
Copy link
Owner

michaelkaye commented Jul 3, 2023

Looks like this is matrix-org/synapse#15858

Ran this repos' unit tests again and it looks like at the moment installing using poetry will find a good dependency:

https://github.com/michaelkaye/setup-matrix-synapse/actions/runs/5442548369/jobs/9897929127

You can adjust the GHA workflow by adding installer: poetry which should work around this until synapse is changed, and is not a bad long-term change. It may change the dependency versions we install synapse with (compared to just pip) but not in a bad way.

https://github.com/michaelkaye/setup-matrix-synapse/actions/runs/5442548369/workflow#L26

LMK if this doesn't work - you can grab us in the QA lobby.

@michaelkaye
Copy link
Owner

Closing just to keep issues tidy; please reopen if you need

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

No branches or pull requests

2 participants