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

upon executing 'python3.9 main.py #51

Open
kiyomiki opened this issue Mar 23, 2024 · 7 comments
Open

upon executing 'python3.9 main.py #51

kiyomiki opened this issue Mar 23, 2024 · 7 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kiyomiki
Copy link

kiyomiki commented Mar 23, 2024

upon executing 'python3.9 main.py' i get this, any fix?

  • Serving Quart app 'main'
  • Debug mode: False
  • Please use an ASGI server (e.g. Hypercorn) directly in production
  • Running on http://127.0.0.1:8000 (CTRL + C to quit)
    [2024-03-23 13:01:33,429] ERROR in app: Exception
    Traceback (most recent call last):
    File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 1671, in startup
    await self.ensure_async(func)()
    File "/home/kiyo/osu-nuts/guweb/main.py", line 31, in mysql_conn
    await glob.db.connect(glob.config.mysql) # type: ignore
    File "/usr/local/lib/python3.9/dist-packages/cmyui/mysql.py", line 37, in connect
    self.pool = await aiomysql.create_pool(**config, autocommit=True)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/pool.py", line 29, in _create_pool
    await pool._fill_free_pool(False)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/pool.py", line 182, in _fill_free_pool
    conn = await connect(echo=self._echo, loop=self._loop,
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 75, in _connect
    await conn._connect()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 540, in _connect
    await self._request_authentication()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 855, in _request_authentication
    await self._process_auth(plugin_name, auth_packet)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 907, in _process_auth
    pkt = await self._read_packet()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 652, in _read_packet
    packet.raise_for_error()
    File "/usr/local/lib/python3.9/dist-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
    File "/usr/local/lib/python3.9/dist-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
    pymysql.err.OperationalError: (1045, "Access denied for user 'kiyo'@'localhost' (using password: YES)")
    Traceback (most recent call last):
    File "/usr/local/lib/python3.9/dist-packages/quart/asgi.py", line 320, in call
    await self.app.startup()
    File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 1671, in startup
    await self.ensure_async(func)()
    File "/home/kiyo/osu-nuts/guweb/main.py", line 31, in mysql_conn
    await glob.db.connect(glob.config.mysql) # type: ignore
    File "/usr/local/lib/python3.9/dist-packages/cmyui/mysql.py", line 37, in connect
    self.pool = await aiomysql.create_pool(**config, autocommit=True)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/pool.py", line 29, in _create_pool
    await pool._fill_free_pool(False)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/pool.py", line 182, in _fill_free_pool
    conn = await connect(echo=self._echo, loop=self._loop,
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 75, in _connect
    await conn._connect()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 540, in _connect
    await self._request_authentication()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 855, in _request_authentication
    await self._process_auth(plugin_name, auth_packet)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 907, in _process_auth
    pkt = await self._read_packet()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 652, in _read_packet
    packet.raise_for_error()
    File "/usr/local/lib/python3.9/dist-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
    File "/usr/local/lib/python3.9/dist-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
    pymysql.err.OperationalError: (1045, "Access denied for user 'kiyo'@'localhost' (using password: YES)")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/kiyo/osu-nuts/guweb/main.py", line 74, in
app.run(port=8000, debug=glob.config.debug) # blocking call
File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 850, in run
loop.run_until_complete(asyncio.gather(*tasks))
File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/usr/local/lib/python3.9/dist-packages/hypercorn/asyncio/init.py", line 44, in serve
await worker_serve(
File "/usr/local/lib/python3.9/dist-packages/hypercorn/asyncio/run.py", line 87, in worker_serve
raise exception
File "/usr/local/lib/python3.9/dist-packages/hypercorn/asyncio/lifespan.py", line 43, in handle_lifespan
await self.app(
File "/usr/local/lib/python3.9/dist-packages/hypercorn/app_wrappers.py", line 34, in call
await self.app(scope, receive, send)
File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 1638, in call
await self.asgi_app(scope, receive, send)
File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 1664, in asgi_app
await asgi_handler(receive, send)
File "/usr/local/lib/python3.9/dist-packages/quart/asgi.py", line 322, in call
await send(
File "/usr/local/lib/python3.9/dist-packages/hypercorn/asyncio/lifespan.py", line 101, in asgi_send
raise LifespanFailureError("startup", message.get("message", ""))
hypercorn.utils.LifespanFailureError: Lifespan failure in startup. '(1045, "Access denied for user 'kiyo'@'localhost' (using password: YES)")'

@kiyomiki kiyomiki added bug Something isn't working help wanted Extra attention is needed labels Mar 23, 2024
@7ez
Copy link
Contributor

7ez commented Mar 23, 2024

kiyo I think the error is self explainable
you do not have access to the database on your account

@kiyomiki
Copy link
Author

right i understand that part, but i just dont know how to give myself access

@7ez
Copy link
Contributor

7ez commented Mar 23, 2024

sudo mysql
grant all on *.* to 'kiyo'@'localhost';
exit

@kiyomiki
Copy link
Author

still getting the same error

@7ez
Copy link
Contributor

7ez commented Mar 23, 2024

are u using docker

@kiyomiki
Copy link
Author

unsure

@kiyomiki
Copy link
Author

i think i am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants