nazrulhadi opened a new issue #15035:
URL: https://github.com/apache/superset/issues/15035


   Hi guys currently i'm facing and issue regarding superset database when i 
run the command superset upgrade db  i hit this error regarding the posix issue 
and saw that the path should be return in string format but receive object
   
   im using python 3.9.5 and this issue also occured in 3.8.10
   
   
   ### Actual results
   ```
   [mohdnazrulhadi@nazrulhadi superset]$ superset db upgrade
   logging was configured successfully
   INFO:superset.utils.logging_configurator:logging was configured successfully
   
/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/flask_caching/__init__.py:201:
 UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively 
disabled.
     warnings.warn(
   Failed to create app
   Traceback (most recent call last):
     File "/usr/lib64/python3.9/pkgutil.py", line 416, in get_importer
       importer = sys.path_importer_cache[path_item]
   KeyError: 
PosixPath('/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs')
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 62, in create_app
       app_initializer.init_app()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 552, in init_app
       self.init_app_in_ctx()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 522, in init_app_in_ctx
       self.configure_url_map_converters()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 599, in configure_url_map_converters
       from superset.utils.url_map_converters import (
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/utils/url_map_converters.py",
 line 21, in <module>
       from superset.models.tags import ObjectTypes
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/models/__init__.py",
 line 17, in <module>
       from . import (
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/models/core.py",
 line 57, in <module>
       from superset import app, db_engine_specs, is_feature_enabled
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs/__init__.py",
 line 40, in <module>
       for (_, name, _) in pkgutil.iter_modules([Path(__file__).parent]):  # 
type: ignore
     File "/usr/lib64/python3.9/pkgutil.py", line 130, in iter_modules
       for i in importers:
     File "/usr/lib64/python3.9/pkgutil.py", line 420, in get_importer
       importer = path_hook(path_item)
     File "<frozen importlib._bootstrap_external>", line 1601, in 
path_hook_for_FileFinder
     File "<frozen importlib._bootstrap_external>", line 1476, in __init__
     File "<frozen importlib._bootstrap_external>", line 177, in _path_isabs
   AttributeError: 'PosixPath' object has no attribute 'startswith'
   ERROR:superset.app:Failed to create app
   Traceback (most recent call last):
     File "/usr/lib64/python3.9/pkgutil.py", line 416, in get_importer
       importer = sys.path_importer_cache[path_item]
   KeyError: 
PosixPath('/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs')
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 62, in create_app
       app_initializer.init_app()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 552, in init_app
       self.init_app_in_ctx()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 522, in init_app_in_ctx
       self.configure_url_map_converters()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 599, in configure_url_map_converters
       from superset.utils.url_map_converters import (
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/utils/url_map_converters.py",
 line 21, in <module>
       from superset.models.tags import ObjectTypes
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/models/__init__.py",
 line 17, in <module>
       from . import (
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/models/core.py",
 line 57, in <module>
       from superset import app, db_engine_specs, is_feature_enabled
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs/__init__.py",
 line 40, in <module>
       for (_, name, _) in pkgutil.iter_modules([Path(__file__).parent]):  # 
type: ignore
     File "/usr/lib64/python3.9/pkgutil.py", line 130, in iter_modules
       for i in importers:
     File "/usr/lib64/python3.9/pkgutil.py", line 420, in get_importer
       importer = path_hook(path_item)
     File "<frozen importlib._bootstrap_external>", line 1601, in 
path_hook_for_FileFinder
     File "<frozen importlib._bootstrap_external>", line 1476, in __init__
     File "<frozen importlib._bootstrap_external>", line 177, in _path_isabs
   AttributeError: 'PosixPath' object has no attribute 'startswith'
   Traceback (most recent call last):
     File "/usr/lib64/python3.9/pkgutil.py", line 416, in get_importer
       importer = sys.path_importer_cache[path_item]
   KeyError: 
PosixPath('/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs')
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/home/mohdnazrulhadi/superset/venv/bin/superset", line 33, in 
<module>
       sys.exit(load_entry_point('apache-superset==1.1.0', 'console_scripts', 
'superset')())
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/click/core.py",
 line 829, in __call__
       return self.main(*args, **kwargs)
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/flask/cli.py",
 line 586, in main
       return super(FlaskGroup, self).main(*args, **kwargs)
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/click/core.py",
 line 782, in main
       rv = self.invoke(ctx)
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/click/core.py",
 line 1256, in invoke
       Command.invoke(self, ctx)
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/click/core.py",
 line 1066, in invoke
       return ctx.invoke(self.callback, **ctx.params)
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/click/core.py",
 line 610, in invoke
       return callback(*args, **kwargs)
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/click/decorators.py",
 line 21, in new_func
       return f(get_current_context(), *args, **kwargs)
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/flask/cli.py",
 line 425, in decorator
       with __ctx.ensure_object(ScriptInfo).load_app().app_context():
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/flask/cli.py",
 line 381, in load_app
       app = call_factory(self, self.create_app)
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/flask/cli.py",
 line 119, in call_factory
       return app_factory()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 69, in create_app
       raise ex
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 62, in create_app
       app_initializer.init_app()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 552, in init_app
       self.init_app_in_ctx()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 522, in init_app_in_ctx
       self.configure_url_map_converters()
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/app.py",
 line 599, in configure_url_map_converters
       from superset.utils.url_map_converters import (
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/utils/url_map_converters.py",
 line 21, in <module>
       from superset.models.tags import ObjectTypes
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/models/__init__.py",
 line 17, in <module>
       from . import (
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/models/core.py",
 line 57, in <module>
       from superset import app, db_engine_specs, is_feature_enabled
     File 
"/home/mohdnazrulhadi/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs/__init__.py",
 line 40, in <module>
       for (_, name, _) in pkgutil.iter_modules([Path(__file__).parent]):  # 
type: ignore
     File "/usr/lib64/python3.9/pkgutil.py", line 130, in iter_modules
       for i in importers:
     File "/usr/lib64/python3.9/pkgutil.py", line 420, in get_importer
       importer = path_hook(path_item)
     File "<frozen importlib._bootstrap_external>", line 1601, in 
path_hook_for_FileFinder
     File "<frozen importlib._bootstrap_external>", line 1476, in __init__
     File "<frozen importlib._bootstrap_external>", line 177, in _path_isabs
   AttributeError: 'PosixPath' object has no attribute 'startswith'
   
   ```
   
   
   #### How to reproduce the bug
   
   1. python3 -m venv venv
   2. . venv/bin/activate
   3. pip install apache-superset --use-feature=2020-resolver
   4. superset db upgrade
   
   ### Environment
   Python 3.9.5
   Flask 1.1.4
   Werkzeug 1.0.1
   (please complete the following information):
   
   - superset version:1.1.0
   - python version: 3.9.5
   - node.js version: v14.17.0
   
   ### 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.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to