dpgaspar / Flask-AppBuilder

Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
BSD 3-Clause "New" or "Revised" License
4.72k stars 1.37k forks source link

This fails when trying to access mounted local files from a docker container: flask fab create-app #1682

Closed valhuber closed 2 years ago

valhuber commented 3 years ago

If you'd like to report a bug in Flask-Appbuilder, fill out the template below. Provide any extra information that may be useful

Responsible disclosure: We want to keep Flask-AppBuilder safe for everyone. If you've discovered a security vulnerability please report to danielvazgaspar@gmail.com.

Environment

Flask-Appbuilder version: Flask-AppBuilder==3.3.0

Running in Docker, creating project on local files: docker run -it --name my_app --rm -v /Users/val/dev/servers:/mnt/my_servers api_logic_server python api_logic_server_cli/cli.py create --project_name=/mnt/my_servers/test

pip freeze output: aniso8601==8.1.1 apispec==3.3.2 attrs==20.3.0 Babel==2.9.0 certifi==2020.12.5 cffi==1.14.4 chardet==4.0.0 click==7.1.2 colorama==0.4.4 cryptography==3.3.1 defusedxml==0.6.0 dnspython==2.1.0 email-validator==1.1.2 Flask==1.1.2 Flask-Admin==1.5.7 Flask-AppBuilder==3.3.0 Flask-Babel==1.0.0 Flask-Cors==3.0.10 Flask-JWT-Extended==3.25.0 Flask-Login==0.4.1 Flask-OpenID==1.2.5 Flask-RESTful==0.3.8 flask-restful-swagger-2==0.35 Flask-SQLAlchemy==2.4.4 flask-swagger-ui==3.36.0 Flask-WTF==0.14.3 greenlet==1.0.0 idna==2.10 inflect==5.0.2 itsdangerous==1.1.0 Jinja2==2.11.2 jsonschema==3.2.0 logicbank==1.0.0 logicbankutils==0.6.0 MarkupSafe==1.1.1 marshmallow==3.10.0 marshmallow-enum==1.5.1 marshmallow-sqlalchemy==0.23.1 pio==0.0.3 prison==0.1.3 psycopg2-binary==2.8.6 pycparser==2.20 Pygments==2.7.4 PyJWT==1.7.1 pymssql==2.2.0 PyMySQL==1.0.2 pyodbc==4.0.30 pyrsistent==0.17.3 python-dateutil==2.8.1 python-dotenv==0.15.0 python3-openid==3.2.0 pytz==2020.5 PyYAML==5.4.1 requests==2.25.1 safrs==2.11.4 six==1.15.0 SQLAlchemy==1.3.24 SQLAlchemy-Utils==0.37.0 urllib3==1.26.4 Werkzeug==1.0.1 WTForms==2.3.3

Describe the expected results

Tell us what should happen.

Paste a minimal example that causes the problem.

Describe the actual results

Tell us what happens instead. This fails trying to access mounted local files from a docker container:

flask fab create-app --name /mnt/my_servers/test/ui/basic_web_app --engine

The actual output:

*** console log describing processing ***
6. Create ui/basic_web_app (import / iterate models)
.. ..Create ui/basic_web_app with command: flask fab create-app --name /mnt/my_servers/test/ui/basic_web_app --engine SQLAlchemy
.. ..Create ui/basic_web_app with command: flask fab create-app --name /mnt/my_servers/test/ui/basic_web_app --engine SQLAlchemy result: Something went wrong [Errno 18] Invalid cross-device link: 'Flask-AppBuilder-Skeleton-master' -> '/mnt/my_servers/test/ui/basic_web_app'\nTry downloading from https://github.com/dpgaspar/Flask-AppBuilder-Skeleton/archive/master.zip
Traceback (most recent call last):
  File "api_logic_server_cli/cli.py", line 917, in <module>
    main()
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
.
===> The builder continues to run, but fails later (no such file or directory), due to the error above

Steps to reproduce

Obtain api_logic_server from: https://hub.docker.com/repositories

docker run -it --name my_app --rm -v /Users/val/dev/servers:/mnt/my_servers api_logic_server # <=== update this line

On the docker container: python api_logic_server_cli/cli.py create --project_name=/mnt/my_servers/test

Accept default database

You should see console messages, followed by the trace above.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to reopen it if it's still relevant to you. Thank you