-
Notifications
You must be signed in to change notification settings - Fork 391
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
SSH module DB exceptions #395
Comments
These are Exception thrown by sqlalchemy, not sure if we can do much about it except updating the package |
Maybe this is relatedd: #209 (comment) |
@NeffIsBack documentation of SQLAlchemy says that this is driver error. I think it can be some kind of misuse of concurrention with SQLite. In my project with async tasks i just used Lock on my side because SQLite support is only one read write operation at the same time anyway. I tried to look for problem by myself but didn't localize it.
Most confusing part is that it write in DB normally but, because it have read problems, there a lot more entities in DB in the end. |
From my understanding sqlalchemy should take care of concurrency issues with sqlite. Of course we are calling the nxcdb from several different (protocol) instances, but that should (afaik) not cause an issue and didn't to me until now. At least when the db file is on my own system drive. Can you reproduce it consistently somehow? If this a normal setup, or some kind of weird folder structure stuff that could confuse sqlalchemy? |
I believe I can reproduce the issue, I'll try to run the command a 100 times and check if the output is always strictly the same or not. I'll report back my findings, on my side it was with |
Just a setup would be nice so i can configure it and reproduce it on my side. Or indicators what the issue could be |
I deployed Game Of Active Directory just as a lab for AD training (using Ludus on Proxmox), I think it would be possible to reproduce the issue with the default env but a more minimal example would help for sure maybe, two Windows VMs |
UPD: While i wrote this i actually though i can try to lock self.session.execute and check locally if it will resolve issue. I will check it now and tell you about result a bit later today @NeffIsBack just normal setup through pipx on ubuntu. Absolutly basic user with my nickname in sudoers, but nxc installed and running without sudo. Everything in their base location like ~/.local and ~/.nxc. I didin't work with DB isolation level much but how i know SQLAlchemy don't care about concurency at all. It just store data in memory based on different scope, dump this data on commit and use lazy load for read. But i work with DB in other direction. I create model and then make migrations with alembic and then create tables, but you create tables and then reflect on them. So i believe this may work differently.
|
@NeffIsBack lock on session execute completely eradicate of InterfaceError
UPD: I will prepare PR in next few day. I think about create base class for database of all protocols. I beleave it's common issue for networks where a lot of hosts with available proto. If you think my solution is acceptable |
Ok. I found that |
Thanks a lot for your digging on this issue @dazzgt Once you find some time to start a PR make sure to tag me along, I will try and test it on my side |
Thanks a lot from me too! Probably @Marshall-Hallenbeck will take a look at the PR as soon as he has the time (he worked on the database the most and has much more knowledge about it than me) |
I see there is a PR open, but wanted to confirm that I am able to replicate this issue.
|
Describe the bug
There is a few exception when i run ssh. Both are connected to db.
To Reproduce
Command:
netexec ssh 172.x.x.x/24 -u realuser -p realpass
Don't think that this is important but there is quite a few machines with this creds in subnet.
Also
winrm
module gave similar errors but where fixed after i ranpipx upgrade-all
so i believe that there were fixes for similar issues in previous two weeks or so. Unfortunatelly i didn't look into error much so it possible that it was some kind of other error.Resulted in:
NetExec info
The text was updated successfully, but these errors were encountered: