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

[BUG] TypeError: constr() got an unexpected keyword argument 'regex' #705

Closed
1 task done
Atreus75 opened this issue Nov 15, 2023 · 2 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@Atreus75
Copy link

Atreus75 commented Nov 15, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Empire Version

5.7.3

Python Version

Python 3

Operating System

Kali Linux 2023.3

Database

MySQL

Current Behavior

After installing all the Python libraries and dependencies, i try to run ./ps-empire server , but i always receive this error message (PS: My linux user is atreus_75 and i'm trying to run Empire on /home/atreus_75/Ferramentas/Post/Empire/):

└─$ ./ps-empire server

/home/atreus_75/.cache/pypoetry/virtualenvs/empire-bc-security-fork-kzkhSqPA-py3.11/lib/python3.11/site-packages/pydantic/_internal/_config.py:318: UserWarning: Valid config keys have changed in V2:
* 'orm_mode' has been renamed to 'from_attributes'
warnings.warn(message, UserWarning)
Traceback (most recent call last):
File "/home/atreus_75/Ferramentas/Post/Empire/empire.py", line 11, in
import empire.server.server as server
File "/home/atreus_75/Ferramentas/Post/Empire/empire/server/server.py", line 14, in
from empire.server.common import empire
File "/home/atreus_75/Ferramentas/Post/Empire/empire/server/common/empire.py", line 21, in
from empire.server.core.agent_service import AgentService
File "/home/atreus_75/Ferramentas/Post/Empire/empire/server/core/agent_service.py", line 9, in
from empire.server.api.v2.agent.agent_dto import AggregateBucket
File "/home/atreus_75/Ferramentas/Post/Empire/empire/server/api/v2/agent/agent_dto.py", line 8, in
from empire.server.api.v2.tag.tag_dto import Tag, domain_to_dto_tag
File "/home/atreus_75/Ferramentas/Post/Empire/empire/server/api/v2/tag/tag_dto.py", line 9, in
TagStr = constr(regex=r"^[^:]+:[^:]+$")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: constr() got an unexpected keyword argument 'regex'

Expected Behavior

I've expected a normal initialization of the Empire Server.

Steps To Reproduce

  1. First, i run git clone https://github.com/BC-SECURITY/Empire.git.
  2. After it, i run Empire/Setup/install.shand everything seems to run normally.
  3. Finally, i run Empire/ps-empire server and i get the error message. I replicated this behavior twice.

Anything else?

image
image
image
image
This behavior is not limited to my personal user, as root still receives that error message.
I've already updated pydantic with both root and my personal user.

@Atreus75 Atreus75 added the bug Something isn't working label Nov 15, 2023
@vinnybod
Copy link

This error is coming from pydantic v2, but the poetry lockfile is using pydantic 1.10. So somewhere along the line your virtual env got the wrong version. I'm not sure how that's possible with the install script since it runs poetry install

You mentioned >I've already updated pydantic with both root and my personal user.
So maybe you manually installed the offending pydantic in your venv

You could rm -rf your virtual env and try poetry install again.

@Atreus75
Copy link
Author

Thank you for your support, friend.

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

2 participants