-
Notifications
You must be signed in to change notification settings - Fork 12
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
NameError: name 'config' is not defined on migrate #10
Comments
I also had this issue and noticed it's a scoping issue with the config variable. See my PR #11 for a working version (at least for me). |
Hmm, I spent some tine yesterday and today looking through the code. Not seeing how you have changed the scope of config by moving it from the Main function to line #110. I also looked through the history and don't see the change you referred to. I'm leaning towards passing config_yaml instead of yaml to test_config() on line #869 |
@PeterSprague The scope of config was only inside the main function before my change. Therefore you get your error in As a quick workaround I moved |
Been refactoring this code over the last week to get it to properly import a "slackdump" export. Running Pylinter and PDB against this code points to all kinds of issues. It seems to be way more than just making a variable local --> global |
@PeterSprague would you be willing to share your changes? (: |
Sure, I'll share the fork url once it actually works fully. I've had to move to other work, but plan to get back to this fairly soon. I have ~15 Slack workgroups to move over to a hosted synapse server |
(venv) [root@matrix-gei /tmp/slack-matrix-migration/slack-matrix-migration]# python slack-matrix-migration/slack-matrix-migration/migrate.py
INFO:SLACK.MIGRATE:Opening zipfile: /tmp/slack-matrix-migration/slack-matrix-migration/data/ve7ppe.slack.dump_aug-14-2022-1604.zip
INFO:SLACK.MIGRATE:Found dms.json in archive. Adding.
INFO:SLACK.MIGRATE:Warning: Couldn't find groups.json in archive. Skipping.
INFO:SLACK.MIGRATE:Warning: Couldn't find mpims.json in archive. Skipping.
INFO:SLACK.MIGRATE:Found channels.json in archive. Adding.
INFO:SLACK.MIGRATE:Found users.json in archive. Adding.
Admin user localpart [root]: gei-admin
Password:
Traceback (most recent call last):
File "/tmp/slack-matrix-migration/slack-matrix-migration/slack-matrix-migration/slack-matrix-migration/migrate.py", line 969, in
main()
File "/tmp/slack-matrix-migration/slack-matrix-migration/slack-matrix-migration/slack-matrix-migration/migrate.py", line 874, in main
admin_user, access_token = login(config["homeserver"])
File "/tmp/slack-matrix-migration/slack-matrix-migration/slack-matrix-migration/slack-matrix-migration/migrate.py", line 201, in login
r = requests.post(url, json=data, verify=config["verify-ssl"])
NameError: name 'config' is not defined
Been all through the README to make sure I followed the instructions. Inserted random strings for AS & HS. Tried to follow the Traceback code, nothing jumped out.
Have a fresh synapse install with an admin user in a FreeBSD jail. Can access from Element app.
Completely stymied. Likely something simple I have missed. Have a few Slack exports I need to get imported for our non-profit volunteers groups before we lose all the history access
The text was updated successfully, but these errors were encountered: