moneroexamples / onion-monero-blockchain-explorer

Onion Monero Blockchain Explorer
https://xmrchain.net
BSD 3-Clause "New" or "Revised" License
361 stars 269 forks source link

[Bug] Requesting alt block triggers HTTP 500 Internal Server Error #308

Closed jeffro256 closed 3 months ago

jeffro256 commented 6 months ago

Basically the title. For example, if you go onto the site right now and request block ID <4540870ca42ce3eed66eaac6e5bc9f1063b3b499a4532fe49b6ea77609e3d07e>, you will get an internal server error response.

This block used to be part of the main chain, until it was reorg'ed out. I don't know about the internal code of this server, so I don't know if that makes a difference. Perhaps there is some cache somewhere that isn't cleaned up.

Gingeropolous commented 6 months ago

welp, restarting the xmrchain process / daemon didn't fix it.

Gingeropolous commented 6 months ago

watching the logs live while i request that blockheight

8 12:56:49 Ubuntu-1804-bionic-64-minimal clearnet_exp.sh[4164353]: MicroCore::get_tx tx does not exist in blockchain: <4540870ca42ce3eed66eaac6e5bc9f1063b3b499a4532fe49b6ea77609e3d07e>
Feb 28 12:56:49 Ubuntu-1804-bionic-64-minimal clearnet_exp.sh[4164353]: Cant get tx in blockchain: <4540870ca42ce3eed66eaac6e5bc9f1063b3b499a4532fe49b6ea77609e3d07e>.
Feb 28 12:56:49 Ubuntu-1804-bionic-64-minimal clearnet_exp.sh[4164353]:  Check mempool now
Feb 28 12:56:49 Ubuntu-1804-bionic-64-minimal clearnet_exp.sh[4164353]: mempool status txs: 87
Feb 28 12:56:49 Ubuntu-1804-bionic-64-minimal clearnet_exp.sh[4164353]: (2024-02-28 11:56:49) [ERROR   ] An uncaught exception occurred: Attempted to retrieve non-existent block height
Feb 28 12:56:49 Ubuntu-1804-bionic-64-minimal clearnet_exp.sh[4164353]: (2024-02-28 11:56:49) [INFO    ] Response: 0x7f729000bbd0 /search?value=4540870ca42ce3eed66eaac6e5bc9f1063b3b499a4532fe49b6ea77609e3d07e 500 0
moneroexamples commented 6 months ago

I can't replicate the issue. Are you using master branch of the explorer with monero-v018?

Gingeropolous commented 6 months ago

im on commit d66972065fd34339451c248b4dfb5c54be0d0719 for the explorer, and

7b7958bbd9d76375c47dc418b4adabba0f0b1785 on monero

according to git log

moneroexamples commented 6 months ago

The commit is only html style style.css change, nothing to do with blockchain functionality. https://xmrchain.net/ seems not affected when using the block id given by OP.

jeffro256 commented 6 months ago

You can go to xmrchain.net right now and type in that blockID into the search bar and get the 500 internal error. Browser: Firefox 122.0.1.

jeffro256 commented 6 months ago

https://xmrchain.net/search?value=4540870ca42ce3eed66eaac6e5bc9f1063b3b499a4532fe49b6ea77609e3d07e

moneroexamples commented 6 months ago

I see. xmrchain (if you check at the bottom) seems to be running version from 2023-03-28. I tested on the current build and there is no such error.

Gingeropolous commented 6 months ago

the webpage never shows the actual compile for some reason. I'll try recompiling from master and see if it fixes this.

Gingeropolous commented 6 months ago

welp, having a trouble compiling. reported in separate issue. #311

Gingeropolous commented 6 months ago

OK, so I just recompiled onion explorer on master using monero on 18.3.1 , and the error still exists.

the version doesn't update on the xmrchain.net page because when I compile I just copy the newly compiled binary to an already existing onion-explorer directory so I don't have to mess with the HTML templates etc.

moneroexamples commented 6 months ago

@Gingeropolous I'm testing on freshly compiled version, and HTTP 500 Internal Server Error does not occur. Instead there is normal explorer info that tx does not exist:

image

jeffro256 commented 6 months ago

@moneroexamples Probably an issue related to some internal state then, either the daemon or the web server. Does the web server cache certain pages / data?

Gingeropolous commented 6 months ago

i'll try running the explorer from a new directory. i'll copy over my html and css into the newly compiled directory.

moneroexamples commented 3 months ago

No updates so closing.