-
Notifications
You must be signed in to change notification settings - Fork 58
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
Exception when trying to update an entry with Update-KeePassEntry #148
Comments
@Wavelandian thanks for reporting. I'll take a look, think I have seen this before on the group level should be easy to fix, will see if I can release a fix by Monday. |
Many thanks for taking a look into this issue.
Today I'm starting my holidays and will be on leave for the next two weeks,
therefore unable to test new updates, if any.
On my return I'll spend more time to deep look into the occurrences and the
differences with the correct entry updates, to see if I can identify a
pattern.
2018-08-03 16:04 GMT+02:00 John Klann <notifications@github.com>:
… @Wavelandian <https://github.com/Wavelandian> thanks for reporting.
I'll take a look, think I have seen this before on the group level should
be easy to fix, will see if I can release a fix by Monday.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#148 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARq-vOevd5sQwZ3Ok42XpUnt_FawtJdnks5uNFhXgaJpZM4VtuiD>
.
|
In my case I can see a clear pattern: this exception occurs whenever I update an entry that has been updated before. |
I was getting the same error this morning, but I added -Confirm:$false and no longer get the error message. |
Hi @jkdba , any update on this? In my case the problem is related with the history collection. If I comment this line: https://github.com/PSKeePass/PoShKeePass/blob/master/internal/Set-KPEntry.ps1#L128 it saves without the error message. Interesting that despite the error it saves the history anyway. (if I select ignore). @wi-fr - with me is consistent. It happens every time |
I'm seeing the same assertion. PSES module version: 1.10.0 |
Think I found a fix for this. I found that if you insert a $OldEntry.History.Clear() right before the $KeePassEntry.History.Add($OldEntry) referenced by @ClaudioESSilva the exception is no longer thrown on an update. |
Just opened another issue with the same problem Is this still being investigated ? |
Hi New to all of this so please bare with me, If i download the files and make this change, how then do i load the module into powershell to be used, instead of the original? |
Seems the project owner hasn't been here is quite some time....the way I did the update: |
Thanks, kdmhorn, your fix solved my problem |
Performing the fix above caused the following exception: |
@DamionD - The above fix wouldn't have caused that - running the command before the fix does, as when the error message appears, if you click abort it leaves your .kdbx file in a incomplete state The fix stops this from happening |
Hi @kdmhorn @SJHarrison1992 can anyone confirm if the history is maintained in the updated entry with the suggested fix? |
I believe it does, but let me check Monday morning when I have access to my test database. What the process is doing is copying the record current state to a new object, it clears the history from that copied object then adds it to the history of the original record before committing the changes made. I'm not great with code (C++ or C#) but had found the fix by tracing what KeePASS source code does with an update. |
Just tested and commited fix, released and pushed to psgallery. |
This seems to still be occurring, even after updating to 2.1.2.0. I could also be doing something wrong though. Any suggestions? |
@xtremedew lets clarify the issue we are seeing. From my testing this is what I found:
After testing with fix this behavior was resolved for me, Can you provide a step by step of how your issue occurs so I can reproduce it. |
@jkdba - I am pretty sure I resolved this on my end. I think I was running old code somewhere. I deleted everything and started again from scratch - No issues now. Sorry for causing any panic or confusion. Thanks for the help! Keep up the good work. |
@xtremedew no worries, glad to know you found it! Just tested again as sanity and still didn't have the issue. Let me know if anything comes up. |
Can confirm history is maintained with the suggested fix Great to see you are maintaining this great library |
@SJHarrison1992 great! Yes not always as frequently as I would like. |
In some cases (most of cases, unable to identify a pattern), when trying to update an entry, by using this command:
Update-KeePassEntry -DatabaseProfileName $KPDBProfileName -MasterKey $KeePassDBPassword -KeePassEntry $entry -Title $title -KeePassEntryGroupPath $groupFullPath -force
I get the below exception:

Details of the machine I'm using:
The text was updated successfully, but these errors were encountered: