Open dtvuong opened 3 years ago
@dtvuong Thank you for creating this issue. And, I'm sorry for my late reply. I can't reproduce the problem in my macOS and Ubuntu 20.10. I guess the problem can't listen to the port. You can use the workaround to change internal port 80 to 8080. Would you please try it?
version: '3.1'
services:
local-data-api:
image: koxudaxi/local-data-api
restart: always
environment:
ENGINE: PostgreSQLJDBC
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: example
RESOURCE_ARN: 'arn:aws:rds:us-east-1:123456789012:cluster:dummy'
SECRET_ARN: 'arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy'
ports:
- "8080:8080"
command: >
java -server
-XX:+UnlockExperimentalVMOptions
-XX:+UseContainerSupport
-XX:+UseG1GC
-XX:MaxGCPauseMillis=100
-XX:+UseStringDeduplication
-jar local-data-api.jar
-port=8080
db:
image: postgres:10.7-alpine
restart: always
environment:
POSTGRES_PASSWORD: example
POSTGRES_DB: test
ports:
- "5432:5432"
@koxudaxi Thanks for your response. I tried with your suggestion and the "Permission denied" error no longer appears but I still cannot access to local data-api. I guess have something wrong with my docker installation. I will check and respond to you later.
どうもありがとうございます。
@dtvuong
I have released a fixed version as 0.6.8
I hope that the change can resolve the problem.
Thank you!!
@koxudaxi I have same problem with latest version. I used version 0.6.8, There can start local-data-api without errors.
aws --endpoint-url http://192.168.1.111:8080 rds-data execute-statement --resource-arn "arn:aws:rds:us-east-2:880529148469:cluster:demo-aurora-cluster" --sql "show * from test_tb" --secret-arn "arn:aws:secretsmanager:us-east-2:880529148469:secret:rds-db-credentials/cluster-E6POBJDHBUQ2NLJHC5ZKDUQWSI/postgres-lh1XFF" --database "demo"
=> Got OK result
(Lib: rds-data-api-client-library-java)
public ExecutionResult getAll() {
AWSRDSData rdsData =
AWSRDSDataClient.builder().withEndpointConfiguration(
new EndpointConfiguration("http://192.168.1.111:8080", AppConfig.REGION)).build();
RdsDataClient rdsClient = RdsDataClient.builder().rdsDataService(rdsData)
.database(AppConfig.DATABASE)
.resourceArn(AppConfig.RESOURCE_ARN).secretArn(AppConfig.SECRET_ARN).build();
return rdsClient.forSql( "SELECT * FROM demo")
.execute();
}
=> There're got errors. Logs in java sample.
2021-04-23T14:41:47,486 INFO [http-nio-8090-exec-1] o.s.w.s.FrameworkServlet: Completed initialization in 0 ms
2021-04-23T14:41:48,010 INFO [http-nio-8090-exec-1] c.a.h.JsonErrorResponseHandler: Unable to unmarshall exception content
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.amazonaws.services.rdsdata.model.AWSRDSDataException` out of NOT_AVAILABLE token
at [Source: UNKNOWN; line: -1, column: -1]
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1468)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1242)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1190)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:203)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:166)
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4497)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2730)
at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:3183)
at com.amazonaws.transform.JsonErrorUnmarshaller.unmarshall(JsonErrorUnmarshaller.java:61)
at com.amazonaws.http.JsonErrorResponseHandler.doLegacyUnmarshall(JsonErrorResponseHandler.java:185)
at com.amazonaws.http.JsonErrorResponseHandler.unmarshallException(JsonErrorResponseHandler.java:147)
at com.amazonaws.http.JsonErrorResponseHandler.createException(JsonErrorResponseHandler.java:131)
at com.amazonaws.http.JsonErrorResponseHandler.handle(JsonErrorResponseHandler.java:94)
at com.amazonaws.http.JsonErrorResponseHandler.handle(JsonErrorResponseHandler.java:40)
at com.amazonaws.http.AwsErrorResponseHandler.handleAse(AwsErrorResponseHandler.java:58)
at com.amazonaws.http.AwsErrorResponseHandler.handle(AwsErrorResponseHandler.java:45)
at com.amazonaws.http.AwsErrorResponseHandler.handle(AwsErrorResponseHandler.java:27)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1801)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleServiceErrorResponse(AmazonHttpClient.java:1403)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1372)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1145)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:802)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:770)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:744)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:704)
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:686)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:550)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:530)
at com.amazonaws.services.rdsdata.AWSRDSDataClient.doInvoke(AWSRDSDataClient.java:653)
at com.amazonaws.services.rdsdata.AWSRDSDataClient.invoke(AWSRDSDataClient.java:620)
at com.amazonaws.services.rdsdata.AWSRDSDataClient.invoke(AWSRDSDataClient.java:609)
at com.amazonaws.services.rdsdata.AWSRDSDataClient.executeExecuteStatement(AWSRDSDataClient.java:507)
at com.amazonaws.services.rdsdata.AWSRDSDataClient.executeStatement(AWSRDSDataClient.java:476)
at com.amazon.rdsdata.client.RdsDataClient.executeStatement(RdsDataClient.java:134)
at com.amazon.rdsdata.client.Executor.executeAsSingle(Executor.java:92)
at com.amazon.rdsdata.client.Executor.execute(Executor.java:77)
at com.example.transaction.service.impl.SampleService.getAll(SampleService.java:41)
at com.example.transaction.controller.SampleController.get(SampleController.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1060)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:962)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:887)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Logs in local-data-api container
Attaching to local-data-api
local-data-api | 2021-04-23 07:41:49.006 [main] TRACE Application - {
local-data-api | # application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 6
local-data-api | "application" : {
local-data-api | # application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 7
local-data-api | "modules" : [
local-data-api | # application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 7
local-data-api | "com.koxudaxi.localDataApi.ApplicationKt.module"
local-data-api | ]
local-data-api | },
local-data-api | # application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 2
local-data-api | "deployment" : {
local-data-api | # application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 3
local-data-api | "port" : 8080
local-data-api | },
local-data-api | # Content hidden
local-data-api | "security" : "***"
local-data-api | }
local-data-api |
local-data-api | 2021-04-23 07:41:49.082 [main] INFO Application - Autoreload is disabled because the development mode is off.
local-data-api | 2021-04-23 07:41:49.470 [main] INFO Application - Responding at http://0.0.0.0:80
local-data-api | 2021-04-23 07:42:20.259 [eventLoopGroupProxy-4-1] ERROR Application - Unhandled: POST - /Execute
local-data-api | kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 167: Encountered an unknown key 'resultSetOptions'.
local-data-api | Use 'ignoreUnknownKeys = true' in 'Json {}' builder to ignore unknown keys.
local-data-api | JSON input: .....-cluster","resultSetOptions":{"decimalReturnType":"STRING"},.....
local-data-api | at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
local-data-api | at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
local-data-api | at kotlinx.serialization.json.internal.JsonReader.fail(JsonReader.kt:338)
local-data-api | at kotlinx.serialization.json.internal.JsonReader.fail$default(JsonReader.kt:337)
local-data-api | at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeObjectIndex(StreamingJsonDecoder.kt:144)
local-data-api | at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeElementIndex(StreamingJsonDecoder.kt:87)
local-data-api | at com.koxudaxi.localDataApi.ExecuteStatementRequest$$serializer.deserialize(Models.kt)
local-data-api | at com.koxudaxi.localDataApi.ExecuteStatementRequest$$serializer.deserialize(Models.kt:56)
local-data-api | at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
local-data-api | at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:32)
local-data-api | at kotlinx.serialization.json.Json.decodeFromString(Json.kt:85)
local-data-api | at io.ktor.serialization.SerializationConverter.convertForReceive(SerializationConverter.kt:161)
local-data-api | at io.ktor.features.ContentNegotiation$Feature$install$3.invokeSuspend(ContentNegotiation.kt:172)
local-data-api | at io.ktor.features.ContentNegotiation$Feature$install$3.invoke(ContentNegotiation.kt)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:243)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:113)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:133)
local-data-api | at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:79)
local-data-api | at io.ktor.request.ApplicationReceiveFunctionsKt.receive(ApplicationReceiveFunctions.kt:116)
local-data-api | at com.koxudaxi.localDataApi.ApplicationKt$module$3$5.invokeSuspend(Application.kt:181)
local-data-api | at com.koxudaxi.localDataApi.ApplicationKt$module$3$5.invoke(Application.kt)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:243)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:113)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:133)
local-data-api | at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:79)
local-data-api | at io.ktor.routing.Routing.executeResult(Routing.kt:155)
local-data-api | at io.ktor.routing.Routing.interceptor(Routing.kt:39)
local-data-api | at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:107)
local-data-api | at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:243)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:113)
local-data-api | at io.ktor.features.ContentNegotiation$Feature$install$1.invokeSuspend(ContentNegotiation.kt:110)
local-data-api | at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:243)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:113)
local-data-api | at io.ktor.features.StatusPages$interceptCall$2.invokeSuspend(StatusPages.kt:102)
local-data-api | at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
local-data-api | at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
local-data-api | at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:194)
local-data-api | at io.ktor.features.StatusPages.interceptCall(StatusPages.kt:101)
local-data-api | at io.ktor.features.StatusPages$Feature$install$2.invokeSuspend(StatusPages.kt:142)
local-data-api | at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:243)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:113)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:133)
local-data-api | at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:79)
local-data-api | at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:124)
local-data-api | at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:243)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:113)
local-data-api | at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:133)
local-data-api | at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:79)
local-data-api | at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:122)
local-data-api | at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
local-data-api | at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
local-data-api | at kotlinx.coroutines.BuildersKt__Builders_commonKt.startCoroutineImpl(Builders.common.kt:194)
local-data-api | at kotlinx.coroutines.BuildersKt.startCoroutineImpl(Unknown Source)
local-data-api | at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:145)
local-data-api | at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
local-data-api | at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
local-data-api | at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:43)
local-data-api | at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:34)
local-data-api | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
local-data-api | at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
local-data-api | at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370)
local-data-api | at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
local-data-api | at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
local-data-api | at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
local-data-api | at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
local-data-api | at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
local-data-api | at io.ktor.server.netty.EventLoopGroupProxy$Companion$create$factory$1$1.run(NettyApplicationEngine.kt:227)
local-data-api | at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
local-data-api | at java.base/java.lang.Thread.run(Unknown Source)
@jackychang113
Thank you for posting the problem.
I have released a new version 0.6.10
that version supports JavaSDK 🚀
I had this permission problem in gitlab CI pipelines with v0.6.4. Upgrading to v0.6.10 helped. Thanks! 🚀
Describe the bug I got the below error when docker-compose up.
To Reproduce Steps to reproduce the behavior:
docker-compose -f docker-compose-postgres.yml up
** Environment