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
Calling login
sometimes fails for a user until OpenMonero is restarted
#154
Comments
Do you know roughly when |
Also, when this happens, do you see any error in the backend printed out? |
The time between the successful and failed requests was likely a few days. Currently running from The 'Relevant lines from OM's log' is what's printed out by the backend when the error occurs. |
If something failed on the backend (e.g., mysql query, json parsing, etc), you should see some error about it on the backen'd console/log. The login issue is difficult to replicate, thus I don't know what could be the reason for that at present. If you can't see anything in the logs, I can add more logging calls to |
Agree this is difficult to replicate, we haven't been able to reproduce the error since. Unfortunately I wasn't able to find anything more helpful in the logs. More verbose logging for |
Actually, this error has also been popping up in the logs:
I'm unable to confirm this is related, but just wanted to pass it along on the off-chance it might help debug anything. |
I added more details to logs bab01c8 . Hopefully this will allow pin down |
The same error cropped up again on
Just like last time, restarting OpenMonero fixed things up. |
I should also mention that we're experimenting with a setup that involves several instances of OpenMonero writing to the same database (in an attempt to scale things up). We've taken steps to prevent simultaneous search threads with the same address/viewkey and have had cursory success with multiple users connected to the system thus far. Just wanted to provide some additional context in case that might factor into the cause. |
If you want to test how it performs under high load you can use this python script: https://github.com/moneroexamples/openmonero/tree/master/scripts You can use it to flood the backend with multiple requests. |
I've been able to reproduce the error on a fresh install of OpenMonero and a clean (singleton, not shared) database. The user has agreed to provide their stagenet address and view key to this issue for troubleshooting. Here's some steps to reproduce:
At block |
Will check. To clarify, this happens when you use the api calls directly, not the html frontend? If so, does it also happen when you use the frontend? |
Encountered this when importing your account in viewonly mode. Pasting this for future reference. Will look more into it.
|
Yep, I'm calling the API directly. I have not used the frontend extensively, so I'm not sure if it also pops up there. |
The problem is caused by two different txs having same outputs sent to your address: Thus TxSearch terminates when processing second tx as it is assumed that outputs are unique. OM does not allow for such a situation at present. Need some time to fix it, as it requires changes to db. The uniqueness of outputs is enforced at sql level: Line 94 in 507bda0
|
Would you mind providing the seed for the stagenet wallet in question? |
Here's the seed with the key details:
|
You can check the following branch: https://github.com/moneroexamples/openmonero/tree/fix_nonunique_outputs It allows for non-unique output public keys. However, txs that you are doing (those with non-unique keys) are highly unusual and not even handled correctly by official monero wallet from what I can see. Thus its very difficult for me to test the changes. I don't know yet if this branch will get merged to OM, as I'm inclined to say that your tx creation procedure that you are using is incorrect. Thus maybe its for the better that such txs cause OM to fail, so the issue could be detected. |
@moneroexamples thanks for having investigated this issue. This test wallet is mine, the one I use for developing Ledger Nano S/X Integration. So those "non std" TX have certainly been generated during my development and test. I know that when I full resync this wallet with monero-cli I have some WARN/ERR about few old TX. Maybe a simple solution is to discard such TX with a warning. I don't know if it is acceptable, but as such TX should not exist it could the simplest solution. |
I think is is good middle-ground. So I will check how can I handle that. |
You can check |
I can confirm that the latest in Thanks so much @moneroexamples and @cslashm! |
I'm testing against a long-running stagenet instance of OpenMonero using the
devel
branch. At times, a user won't be able to call thelogin
endpoint successfully and will be locked out until OpenMonero is restarted. Previously, the address/viewkey was able to log in just fine.Here's the request:
The response:
Relevant lines from OM's log:
A restart of OpenMonero produces a successful response with the same request:
The text was updated successfully, but these errors were encountered: