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: The server returned an error. See the server logs for more details. If you are running in Colab, this function is probably not supported. Please try running in a local environment. #702

Open
SharkSyl opened this issue Nov 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SharkSyl
Copy link

Describe the bug

I have vanna running in docker, but I'm getting the following error when submitting my training

Error: The server returned an error. See the server logs for more details. If you are running in Colab, this function is probably not
supported. Please try running in a local environment.

image

To Reproduce
Core content of the app.py file

index_html_path = os.path.abspath('./static/index.html')
logo_path = os.path.abspath('./static/assets/vanna.svg')
assets_folder = os.path.abspath('./static/assets')

app = VannaFlaskApp(
    vn,
    auth=SimplePassword(users=accounts.users, tokens=accounts.tokens),
    allow_llm_to_see_data=True,
    debug=True,
    logo=logo_path,
    index_html_path=index_html_path,
    assets_folder=assets_folder
)

Full content of the index.html file

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/assets/vanna.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@350&display=swap" rel="stylesheet">
    <script src="https://cdn.plot.ly/plotly-latest.min.js" type="text/javascript"></script>
    <title>Vanna.AI</title>
    <script type="module" crossorigin src="/assets/index-2dc047a4.js"></script>
    <link rel="stylesheet" href="/assets/index-a3ae634d.css">
  </head>
  <body class="bg-white dark:bg-slate-900">
    <div id="app"></div>
    
  </body>
</html>

Error logs

2024-11-14T05:43:04.707037285Z Traceback (most recent call last):
2024-11-14T05:43:04.707040046Z   File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 667, in send
2024-11-14T05:43:04.707042991Z     resp = conn.urlopen(
2024-11-14T05:43:04.707045775Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 843, in urlopen
2024-11-14T05:43:04.707048730Z     retries = retries.increment(
2024-11-14T05:43:04.707051493Z   File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 519, in increment
2024-11-14T05:43:04.707055770Z     raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
2024-11-14T05:43:04.707060043Z urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='vanna.ai', port=443): Max retries exceeded with url: /img/vanna.svg (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f10cb9a0ee0>, 'Connection to vanna.ai timed out. (connect timeout=None)'))
2024-11-14T05:43:04.707063493Z 
2024-11-14T05:43:04.707066201Z During handling of the above exception, another exception occurred:
2024-11-14T05:43:04.707072641Z 
2024-11-14T05:43:04.707075489Z Traceback (most recent call last):
2024-11-14T05:43:04.707078291Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1463, in wsgi_app
2024-11-14T05:43:04.707081175Z     response = self.full_dispatch_request()
2024-11-14T05:43:04.707083977Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 872, in full_dispatch_request
2024-11-14T05:43:04.707086930Z     rv = self.handle_user_exception(e)
2024-11-14T05:43:04.707089720Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 870, in full_dispatch_request
2024-11-14T05:43:04.707092703Z     rv = self.dispatch_request()
2024-11-14T05:43:04.707095481Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 855, in dispatch_request
2024-11-14T05:43:04.707098407Z     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
2024-11-14T05:43:04.707101400Z   File "/usr/local/lib/python3.10/site-packages/vanna/flask/__init__.py", line 1276, in proxy_vanna_svg
2024-11-14T05:43:04.707104372Z     response = requests.get(remote_url, stream=True)
2024-11-14T05:43:04.707107183Z   File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
2024-11-14T05:43:04.707110071Z     return request("get", url, params=params, **kwargs)
2024-11-14T05:43:04.707113028Z   File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
2024-11-14T05:43:04.707115928Z     return session.request(method=method, url=url, **kwargs)
2024-11-14T05:43:04.707118773Z   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
2024-11-14T05:43:04.707121739Z     resp = self.send(prep, **send_kwargs)
2024-11-14T05:43:04.707124543Z   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
2024-11-14T05:43:04.707127499Z     r = adapter.send(request, **kwargs)
2024-11-14T05:43:04.707130250Z   File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 688, in send
2024-11-14T05:43:04.707133616Z     raise ConnectTimeout(e, request=request)
2024-11-14T05:43:04.707136878Z requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='vanna.ai', port=443): Max retries exceeded with url: /img/vanna.svg (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f10cb9a0ee0>, 'Connection to vanna.ai timed out. (connect timeout=None)'))
2024-11-14T05:43:09.954900441Z [2024-11-14 13:43:09,954] ERROR in app: Exception on /vanna.svg [GET]
2024-11-14T05:43:09.954932822Z Traceback (most recent call last):
2024-11-14T05:43:09.954937482Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 199, in _new_conn
2024-11-14T05:43:09.954942589Z     sock = connection.create_connection(
2024-11-14T05:43:09.954946462Z   File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
2024-11-14T05:43:09.954959922Z     raise err
2024-11-14T05:43:09.954963003Z   File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 73, in create_connection
2024-11-14T05:43:09.954966439Z     sock.connect(sa)
2024-11-14T05:43:09.954969394Z TimeoutError: [Errno 110] Connection timed out
2024-11-14T05:43:09.954972418Z 
2024-11-14T05:43:09.954975202Z The above exception was the direct cause of the following exception:
2024-11-14T05:43:09.954978288Z 
2024-11-14T05:43:09.954982785Z Traceback (most recent call last):
2024-11-14T05:43:09.954985905Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 789, in urlopen
2024-11-14T05:43:09.954988847Z     response = self._make_request(
2024-11-14T05:43:09.954991620Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 490, in _make_request
2024-11-14T05:43:09.954994632Z     raise new_e
2024-11-14T05:43:09.954997546Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 466, in _make_request
2024-11-14T05:43:09.955000511Z     self._validate_conn(conn)
2024-11-14T05:43:09.955003326Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
2024-11-14T05:43:09.955006317Z     conn.connect()
2024-11-14T05:43:09.955009180Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 693, in connect
2024-11-14T05:43:09.955012152Z     self.sock = sock = self._new_conn()
2024-11-14T05:43:09.955014956Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 208, in _new_conn
2024-11-14T05:43:09.955017975Z     raise ConnectTimeoutError(
2024-11-14T05:43:09.955020902Z urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7f10c8bc6260>, 'Connection to vanna.ai timed out. (connect timeout=None)')
2024-11-14T05:43:09.955024500Z 
2024-11-14T05:43:09.955027325Z The above exception was the direct cause of the following exception:
2024-11-14T05:43:09.955030204Z 
2024-11-14T05:43:09.955032918Z Traceback (most recent call last):
2024-11-14T05:43:09.955035696Z   File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 667, in send
2024-11-14T05:43:09.955038612Z     resp = conn.urlopen(
2024-11-14T05:43:09.955041416Z   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 843, in urlopen
2024-11-14T05:43:09.955044358Z     retries = retries.increment(
2024-11-14T05:43:09.955047177Z   File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 519, in increment
2024-11-14T05:43:09.955051971Z     raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
2024-11-14T05:43:09.955056251Z urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='vanna.ai', port=443): Max retries exceeded with url: /img/vanna.svg (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f10c8bc6260>, 'Connection to vanna.ai timed out. (connect timeout=None)'))
2024-11-14T05:43:09.955062996Z 
2024-11-14T05:43:09.955065825Z During handling of the above exception, another exception occurred:
2024-11-14T05:43:09.955068775Z 
2024-11-14T05:43:09.955071509Z Traceback (most recent call last):
2024-11-14T05:43:09.955074330Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1463, in wsgi_app
2024-11-14T05:43:09.955077279Z     response = self.full_dispatch_request()
2024-11-14T05:43:09.955080163Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 872, in full_dispatch_request
2024-11-14T05:43:09.955083108Z     rv = self.handle_user_exception(e)
2024-11-14T05:43:09.955085947Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 870, in full_dispatch_request
2024-11-14T05:43:09.955089072Z     rv = self.dispatch_request()
2024-11-14T05:43:09.955091860Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 855, in dispatch_request
2024-11-14T05:43:09.955094981Z     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
2024-11-14T05:43:09.955098039Z   File "/usr/local/lib/python3.10/site-packages/vanna/flask/__init__.py", line 1276, in proxy_vanna_svg
2024-11-14T05:43:09.955101013Z     response = requests.get(remote_url, stream=True)
2024-11-14T05:43:09.955103859Z   File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
2024-11-14T05:43:09.955106822Z     return request("get", url, params=params, **kwargs)
2024-11-14T05:43:09.955109829Z   File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
2024-11-14T05:43:09.955112766Z     return session.request(method=method, url=url, **kwargs)
2024-11-14T05:43:09.955115639Z   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
2024-11-14T05:43:09.955119003Z     resp = self.send(prep, **send_kwargs)
2024-11-14T05:43:09.955121995Z   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
2024-11-14T05:43:09.955124886Z     r = adapter.send(request, **kwargs)
2024-11-14T05:43:09.955127674Z   File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 688, in send
2024-11-14T05:43:09.955130571Z     raise ConnectTimeout(e, request=request)
2024-11-14T05:43:09.955134066Z requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='vanna.ai', port=443): Max retries exceeded with url: /img/vanna.svg (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f10c8bc6260>, 'Connection to vanna.ai timed out. (connect timeout=None)'))

Desktop (please complete the following information where):

  • OS: [e.g. Ubuntu]
  • Version: [e.g. 20.04]
  • Python: [3.10]
  • Vanna: [0.7.5]

Additional context
I tested it and the result seems to be that all routes return the content of index.html by this method. vanna/flask/__init__.py

@self.flask_app.route("/index", defaults={"path": ""})
@self.flask_app.route("/<path:path>")
def hello(path: str):
    if self.index_html_path:
        directory = os.path.dirname(self.index_html_path)
        filename = os.path.basename(self.index_html_path)
        return send_from_directory(directory=directory, path=filename)
    return html_content
@SharkSyl SharkSyl added the bug Something isn't working label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant