aionnetwork / aion

Aion Network - Java Implementation
https://theoan.com/
MIT License
337 stars 113 forks source link

Setting DB logging to trace causes stratum_getwork to fail with a null pointer exception #527

Closed aion-Ross closed 5 years ago

aion-Ross commented 6 years ago

Before filing a new issue, please provide the following information.

I'm running:

  • Which Aion version?: 0.2.7.1bbeec1
  • Which operating system?: Linux
  • Which distributor and version?: Ubuntu 18.04
  • How installed?: via binaries
  • Are you fully synchronized?: no (Private test network)
  • Did you try to restart the node?: yes

Your issue description goes here below. Try to include actual vs. expected behavior and steps to reproduce the issue.

Setting DB logging to trace in the config file causes a null pointer exception in the stratum_getwork API.

The issue can be reproduced with the following log settings.

        <log>
                <GEN>DEBUG</GEN>
                <VM>TRACE</VM>
                <API>TRACE</API>
                <SYNC>TRACE</SYNC>
                <CONS>TRACE</CONS>
                <DB>TRACE</DB>
                <TX>TRACE</TX>
                <TXPOOL>TRACE</TXPOOL>
        </log>

This leads to the follow error when attempting to call the get_work method.

18-06-15 14:22:42.863 DEBUG API  [rpc-worker-1]: <rpc-server - internal error [2]>
java.lang.NullPointerException: null
    at org.aion.api.server.http.ApiWeb3Aion.stratum_getwork(Unknown Source)
    at org.aion.api.server.rpc.RpcMethods.lambda$new$62(Unknown Source)
    at org.aion.api.server.rpc.RpcProcessor.processObject(Unknown Source)
    at org.aion.api.server.rpc.RpcProcessor.handleSingle(Unknown Source)
    at org.aion.api.server.rpc.RpcProcessor.process(Unknown Source)
    at org.aion.api.server.nanohttpd.NanoHttpd.respond(Unknown Source)
    at org.aion.api.server.nanohttpd.NanoHttpd.serve(Unknown Source)
    at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
    at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:844)

I suspect the trace setting may be causing an issue when creating new blocks which leads to this null pointer exception.

qoire commented 6 years ago

@aion-Ross confirmed this was fixed in latest PR?

aion-Ross commented 6 years ago

Last PR only fixed the RPC issue, will need to verify this issue still exists in 0.2.8