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

Error while initializing the database (superset db upgrade) for superset in editable mode. #22418

Open
episkey24 opened this issue Dec 14, 2022 · 7 comments
Labels
#bug Bug report need:more-info Requires more information from author

Comments

@episkey24
Copy link

While trying to install Superset in the editable mode on running superset db upgrade, I keep running into this issue where the value being passed to the uuid module is a 'function' object instead of a string, which isn't the expected type giving this error:

Error Log:

File "/Users/tannishtha./superset/superset-local-editable-7/lib/python3.9/site-packages/sqlalchemy/sql/type_api.py", line 1631, in process
    return impl_processor(process_param(value, dialect))
  File "/Users/tannishtha./superset/superset-local-editable-7/lib/python3.9/site-packages/sqlalchemy_utils/types/uuid.py", line 86, in process_bind_param
    value = self._coerce(value)
  File "/Users/tannishtha./superset/superset-local-editable-7/lib/python3.9/site-packages/sqlalchemy_utils/types/uuid.py", line 65, in _coerce
    value = uuid.UUID(value)
  File "/Users/tannishtha./opt/anaconda3/lib/python3.9/uuid.py", line 174, in __init__
    hex = hex.replace('urn:', '').replace('uuid:', '')
sqlalchemy.exc.StatementError: (builtins.AttributeError) 'function' object has no attribute 'replace'
[SQL: UPDATE sl_tables SET uuid=?, changed_on=? WHERE sl_tables.id = ?]
[parameters: [{'uuid': <function uuid4 at 0x7fd2b9d770d0>, 'sl_tables_id': 1}, {'uuid': <function uuid4 at 0x7fd2b9d770d0>, 'sl_tables_id': 2}, {'uuid': <function  ... (1143 characters truncated) ... l_tables_id': 20}, {'uuid': <function uuid4 at 0x7fd2b9d770d0>, 'sl_tables_id': 21}, {'uuid': <function uuid4 at 0x7fd2b9d770d0>, 'sl_tables_id': 22}]]

Since, I'm installing in the editable mode, the versions of the external dependencies are as specified in the requirements/testing.txt file.

  • browser type and version: Safari Version 16.0
  • superset version: Superset 0.0.0-dev
  • python version: Python 3.9.13
  • node.js version: v12.17.0
  • any feature flags active:

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [✅ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ ✅] I have reproduced the issue with at least the latest released version of superset.
  • [✅ ] I have checked the issue tracker for the same issue and I haven't found one similar.
@episkey24 episkey24 added the #bug Bug report label Dec 14, 2022
@mayurnewase
Copy link
Contributor

whats the correct superset version?
Superset 0.0.0-dev will show on every superset version if its run with development mode.

@mayurnewase mayurnewase added the need:more-info Requires more information from author label Dec 18, 2022
@episkey24
Copy link
Author

It's the latest release, did a git clone from the master branch today. @mayurnewase

@episkey24
Copy link
Author

It's not giving the same error on a different machine with python version 3.9.7. Tried downgrading python to 3.9.7 but it's still giving the same error.

@gonzalo
Copy link

gonzalo commented Apr 24, 2023

Well, not sure if it will be helpful for other as I'm using teh amancevice/superset docker image but I had to move first to 1.5.1 then to 2.0.0 run db upgrades, and finally move 2.1.0 to be able to run all db migrations.

@rusackas
Copy link
Member

Since we're now on 3.1, on the verge of 4.0, we're not supporting 2.x or prior versions actively. If anyone is experiencing this issue in current versions, please file a new issue with updated context and repro steps. Thank you for understanding :)

@wisefool769
Copy link

@rusackas can we reopen this? I think there is something to get to the bottom of here.
I used version 3.1 on python 3.9.18 and got the same error. In order to fix it I changed migrations/shared/utils.py
I changed the line with obj.uuid = uuid4 to obj.uuid = uuid4(). I am not sure why way more people don't get this bug when they run superset db upgrade, but perhaps this points the way to the root cause? Is it possible that this is a bug?

@rusackas rusackas reopened this Feb 27, 2024
@rusackas
Copy link
Member

Maybe @dpgaspar or @villebro might know something about the uuid issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report need:more-info Requires more information from author
Projects
None yet
Development

No branches or pull requests

5 participants