ut-astria / orbdetpy

Orbit Determination with Python
https://ut-astria.github.io/orbdetpy
GNU General Public License v3.0
115 stars 38 forks source link

"java.lang.IllegalArgumentException: Illegal Capacity: -2147483647 #14

Closed enritoomey closed 3 years ago

enritoomey commented 4 years ago

Whenever I call simulate_measurements() function with a config as a dict, I get the following error message from the java server:

In [31]: print(si.simulate_measurements(config, output_file="output.json"))                                                                                                                                        
Traceback (most recent call last):
  File "/home/henry/SATELLOGIC_REPOS/AOCS/gps/orbitfit/venv/lib/python3.7/site-packages/orbdetpy/simulation.py", line 51, in simulate_measurements
    sim_data = convert_measurements(req.result().array)
  File "/home/henry/SATELLOGIC_REPOS/AOCS/gps/orbitfit/venv/lib/python3.7/site-packages/grpc/_channel.py", line 625, in result
    raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
        status = StatusCode.INTERNAL
        details = "java.lang.IllegalArgumentException: Illegal Capacity: -2147483647
        at java.util.ArrayList.<init>(ArrayList.java:157)
        at org.astria.Simulation.simulateMeasurements(Simulation.java:93)
        at org.astria.rpc.SimulationService.simulateMeasurements(SimulationService.java:36)
        at org.astria.rpc.SimulationGrpc$MethodHandlers.invoke(SimulationGrpc.java:217)
        at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)
        at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
        at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:817)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
"
        debug_error_string = "{"created":"@1589680671.517410712","description":"Error received from peer ipv4:127.0.0.1:50051","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"java.lang.IllegalArgumentException: Illegal Capacity: -2147483647\n\tat java.util.ArrayList.<init>(ArrayList.java:157)\n\tat org.astria.Simulation.simulateMeasurements(Simulation.java:93)\n\tat org.astria.rpc.SimulationService.simulateMeasurements(SimulationService.java:36)\n\tat org.astria.rpc.SimulationGrpc$MethodHandlers.invoke(SimulationGrpc.java:217)\n\tat io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)\n\tat io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)\n\tat io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:817)\n\tat io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)\n\tat io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","grpc_status":13}"
>

I get this error even when I use the config files in example/data directory.

This does not happens when config is a file path. I'm working from a virtualenv with python 3.7.2, from a debian9 machine with the following java version:

$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~deb9u1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
Shiva-Iyer commented 3 years ago

orbdetpy no longer uses the JSON export/import semantics starting with v2.0.0. It now uses a more declarative function call model for passing parameters. Closing this issue because there is no plan to bug fix old releases.