local-data-api: JVM Crashes
Describe the bug When performing the execute-statement request, I get the following error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f7168a9d0f9, pid=74, tid=0x00007f71707e4b88
#
# JRE version: OpenJDK Runtime Environment (8.0_222-b10) (build 1.8.0_222-b10)
# Java VM: OpenJDK 64-Bit Server VM (25.222-b10 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 3.13.0
# Distribution: Custom build (Tue Oct 1 11:00:28 UTC 2019)
# Problematic frame:
# C [_jpype.cpython-37m-x86_64-linux-gnu.so+0x430f9] JPJavaEnv::NewLocalRef(_jobject*)+0x9
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /app/hs_err_pid74.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
# https://icedtea.classpath.org/bugzilla
#
To Reproduce
- Start the docker image:
run --rm -it --name my-data-api -p 8080:80 -e MYSQL_HOST=127.0.0.1 -e MYSQL_PORT=3306 -e MYSQL_USER=root -e MYSQL_PASSWORD= -e RESOURCE_ARN=arn:aws:rds:us-east-1:123456789012:cluster:dummy -e SECRET_ARN=arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy koxudaxi/local-data-api - Perform a request:
aws --endpoint-url http://127.0.0.1:8080 rds-data execute-statement --resource-arn "arn:aws:rds:us-east-1:123456789012:cluster:dummy" --sql "show databases" --secret-arn "arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy" --database 'test'
Expected behavior The Local Data API should return some data. Does anyone have any idea what could be the root cause of this issue?
Desktop (please complete the following information):
- OS: iOS
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (12 by maintainers)
@koxudaxi happy to help - thanks so much for making this in the first place!
Hi @koxudaxi
I also have this issue on a Mac.
@MarkHerhold Thank you for showing me the way to reproduce the error.
I understand why the error happens.
I fixed a bug around auto-commit on JDBC. But, I forgot to handle a case that runs execute-statement without
transactionId. https://github.com/koxudaxi/local-data-api/pull/67I have fixed the problem and released it as
0.4.15.Would you please test it?
I think this project must have unit tests with real MySQL and PostgreSQL. I will check your PR for it 🤓
@koxudaxi I encounter different errors with that PR, even locally.
Query:
Logs:
Reproduce:
Side note: I also saw
jaydebeapi.DatabaseError: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabledbut that could be my fault. Not sure yet.As a potentially helpful tip (how I solved this for my case), when you are NOT using Docker Compose, and working with a locally running database, at least on macOS, you can set the DB HOST (e.g.
POSTGRES_HOSTorMYSQL_HOST) tohost.docker.internal. For example, I’m using this with Postgres that is already running via Brew on my machine:Thank you, I’ve got this working now!
Facing the same problem in OS X:
when running command in cli:
aws --endpoint-url 'http://127.0.0.1:8080' rds-data execute-statement --database 'test_db' --resource-arn 'test_resource_arn' --secret-arn 'test_secrect_arn' --sql 'CREATE TABLE TEST(id Int)'using docker-compose:
However, a few days ago it worked, the same setup. Tried to prune the docker system, additionally deleted the images for mysql and local-data-api and pulled it again - it didn’t resolve the issue above.