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 executing the Server for the first time. #688

Closed
GuilderK opened this issue Aug 5, 2023 · 2 comments
Closed

Error while executing the Server for the first time. #688

GuilderK opened this issue Aug 5, 2023 · 2 comments
Labels
bug Something isn't working missing information Provide more information for us to work this issue.

Comments

@GuilderK
Copy link

GuilderK commented Aug 5, 2023

Note: Please fill out all sections (if applicable) and do not delete the below section headers, otherwise the bot will close the issue.

Empire Version

  • Empire 3.x

OS Information (Linux flavor, Python version)

  • OS:
  • Python:

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

@GuilderK GuilderK added the bug Something isn't working label Aug 5, 2023
@GuilderK
Copy link
Author

GuilderK commented Aug 5, 2023

I follow the instructions step-by-step.

But, when I run the server, I receive this error message:

Traceback (most recent call last):
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
self.dialect.do_execute(
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 921, in do_execute
cursor.execute(statement, parameters)
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/cursors.py", line 163, in execute
result = self._query(query)
^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/cursors.py", line 321, in _query
conn.query(q)
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 505, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 724, in _read_query_result
result.read()
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 1069, in read
first_packet = self.connection._read_packet()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 676, in _read_packet
packet.raise_for_error()
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/protocol.py", line 223, in raise_for_error
err.raise_mysql_exception(self._data)
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'empire.user_id_seq' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Empire/empire.py", line 11, in
import empire.server.server as server
File "/Empire/empire/server/server.py", line 14, in
from empire.server.api import app
File "/Empire/empire/server/api/app.py", line 15, in
from empire.server.api.v2.websocket.socketio import setup_socket_events
File "/Empire/empire/server/api/v2/websocket/socketio.py", line 7, in
from empire.server.api import jwt_auth
File "/Empire/empire/server/api/jwt_auth.py", line 12, in
from empire.server.api.v2.shared_dependencies import get_db
File "/Empire/empire/server/api/v2/shared_dependencies.py", line 1, in
from empire.server.core.db.base import SessionLocal
File "/Empire/empire/server/core/db/base.py", line 132, in
if len(db.query(models.Config).all()) == 0:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2692, in all
return self._iter().all() # type: ignore
^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 2846, in _iter
result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2246, in execute
return self._execute_internal(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2120, in _execute_internal
) = compile_state_cls.orm_pre_session_exec(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 543, in orm_pre_session_exec
session._autoflush()
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2923, in _autoflush
raise e.with_traceback(sys.exc_info()[2])
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2912, in _autoflush
self.flush()
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4163, in flush
self._flush(objects)
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4298, in _flush
with util.safe_reraise():
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 147, in exit
raise exc_value.with_traceback(exc_tb)
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4259, in _flush
flush_context.execute()
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py", line 466, in execute
rec.execute(self)
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py", line 642, in execute
util.preloaded.orm_persistence.save_obj(
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 93, in save_obj
_emit_insert_statements(
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 1226, in _emit_insert_statements
result = connection.execute(
^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1412, in execute
return meth(
^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 483, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1635, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1844, in _execute_context
return self._exec_single_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1984, in _exec_single_context
self._handle_dbapi_exception(
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2339, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
self.dialect.do_execute(
File "/Empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 921, in do_execute
cursor.execute(statement, parameters)
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/cursors.py", line 163, in execute
result = self._query(query)
^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/cursors.py", line 321, in _query
conn.query(q)
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 505, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 724, in _read_query_result
result.read()
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 1069, in read
first_packet = self.connection._read_packet()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 676, in _read_packet
packet.raise_for_error()
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/protocol.py", line 223, in raise_for_error
err.raise_mysql_exception(self._data)
File "/Empire/.venv/lib/python3.11/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(pymysql.err.ProgrammingError) (1146, "Table 'empire.user_id_seq' doesn't exist")
[SQL: INSERT INTO users (id, username, hashed_password, api_token, enabled, admin, notes, created_at, updated_at) VALUES (nextval(user_id_seq), %(username)s, %(hashed_password)s, %(api_token)s, %(enabled)s, %(admin)s, %(notes)s, CONVERT_TZ(CURRENT_TIMESTAMP, @@session.time_zone, '+00:00'), CONVERT_TZ(CURRENT_TIMESTAMP, @@session.time_zone, '+00:00')) RETURNING users.id, users.created_at, users.updated_at]
[parameters: {'username': 'empireadmin', 'hashed_password': '$2b$12$1a51myWLcuptkiSmo4/92esCllZ1bp/QKVm0GRsC2eT5P.nieBdd6', 'api_token': None, 'enabled': 1, 'admin': 1, 'notes': None}]
(Background on this error at: https://sqlalche.me/e/20/f405)

@Cx01N Cx01N added the missing information Provide more information for us to work this issue. label Aug 7, 2023
@Cx01N
Copy link

Cx01N commented Aug 7, 2023

Please fill out the form for us to begin helping with your issue.

vinnybod pushed a commit that referenced this issue Oct 17, 2023
#688)

* Fixed issue with multiple parameters not executing in IronPython for C# tasks

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working missing information Provide more information for us to work this issue.
Projects
None yet
Development

No branches or pull requests

3 participants