lyft / presto-gateway

A load balancer / proxy / gateway for prestodb
Apache License 2.0
358 stars 156 forks source link

How to run this project in Intellij debug mode? #201

Closed andythsu closed 1 year ago

andythsu commented 1 year ago

When I tried to run gateway-ha in debug mode via Intellij, I got the following

Listening for transport dt_socket at address: 12345
Connected to the target VM, address: 'localhost:12345', transport: 'socket'
INFO  [2023-06-23 14:48:29,056] org.eclipse.jetty.util.log: Logging initialized @1922ms to org.eclipse.jetty.util.log.Slf4jLog
INFO  [2023-06-23 14:48:29,127] io.dropwizard.server.DefaultServerFactory: Registering jersey handler with root path prefix: /
INFO  [2023-06-23 14:48:29,129] io.dropwizard.server.DefaultServerFactory: Registering admin handler with root path prefix: /
INFO  [2023-06-23 14:48:29,129] io.dropwizard.assets.AssetsBundle: Registering AssetBundle with name: assets for path /assets/*
INFO  [2023-06-23 14:48:29,152] com.lyft.data.baseapp.BaseApp: Trying to load module [com.lyft.data.gateway.ha.module.HaGatewayProviderModule]
INFO  [2023-06-23 14:48:29,186] com.lyft.data.gateway.ha.router.BackendStateManager: state check configured
INFO  [2023-06-23 14:48:29,186] com.lyft.data.baseapp.BaseApp: Trying to load module [com.lyft.data.gateway.ha.module.ClusterStateListenerModule]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/home/asu80/.m2/repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO  [2023-06-23 14:48:29,397] com.lyft.data.baseapp.BaseApp: op=register_start configuration=HaGatewayConfiguration(requestRouter=RequestRouterConfiguration(port=8080, name=prestoRouter, ssl=false, keystorePath=null, keystorePass=null, historySize=1000, forwardKeystore=false), notifier=null, dataStore=DataStoreConfiguration(jdbcUrl=jdbc:mysql://localhost:3306/prestogateway, user=root, password=root123, driver=com.mysql.cj.jdbc.Driver, queryHistoryHoursRetention=24), monitor=MonitorConfiguration(connectionTimeout=15, taskDelayMin=1), routingRules=RoutingRulesConfiguration(rulesEngineEnabled=false, rulesConfigPath=null), authentication=null, authorization=null, presetUsers={}, backendState=BackendStateConfiguration(username=lb_query, password=null, ssl=false))
INFO  [2023-06-23 14:48:29,399] com.lyft.data.baseapp.BaseApp: op=register type=auth filter item=class io.dropwizard.auth.AuthFilter
INFO  [2023-06-23 14:48:29,473] com.lyft.data.baseapp.BaseApp: op=register type=managed item=class com.lyft.data.gateway.ha.GatewayManagedApp
INFO  [2023-06-23 14:48:29,478] com.lyft.data.gateway.ha.clustermonitor.ActiveClusterMonitor: Running cluster monitor with connection timeout of 15 and task delay of 1
INFO  [2023-06-23 14:48:29,478] com.lyft.data.baseapp.BaseApp: op=register type=managed item=class com.lyft.data.gateway.ha.clustermonitor.ActiveClusterMonitor
INFO  [2023-06-23 14:48:29,494] com.lyft.data.baseapp.BaseApp: op=register type=resource item=class com.lyft.data.gateway.ha.resource.EntityEditorResource
INFO  [2023-06-23 14:48:29,500] com.lyft.data.baseapp.BaseApp: op=register type=resource item=class com.lyft.data.gateway.ha.resource.PrestoResource
INFO  [2023-06-23 14:48:29,502] com.lyft.data.baseapp.BaseApp: op=register type=resource item=class com.lyft.data.gateway.ha.resource.HaGatewayResource
INFO  [2023-06-23 14:48:29,506] com.lyft.data.baseapp.BaseApp: op=register type=resource item=class com.lyft.data.gateway.ha.resource.GatewayResource
INFO  [2023-06-23 14:48:29,513] com.lyft.data.baseapp.BaseApp: op=register type=resource item=class com.lyft.data.gateway.ha.resource.LoginResource
INFO  [2023-06-23 14:48:29,519] com.lyft.data.baseapp.BaseApp: op=register type=resource item=class com.lyft.data.gateway.ha.resource.GatewayViewResource
INFO  [2023-06-23 14:48:29,522] com.lyft.data.baseapp.BaseApp: op=register type=resource item=class com.lyft.data.gateway.ha.resource.PublicResource
INFO  [2023-06-23 14:48:29,522] com.lyft.data.baseapp.BaseApp: op=register_end configuration=HaGatewayConfiguration(requestRouter=RequestRouterConfiguration(port=8080, name=prestoRouter, ssl=false, keystorePath=null, keystorePass=null, historySize=1000, forwardKeystore=false), notifier=null, dataStore=DataStoreConfiguration(jdbcUrl=jdbc:mysql://localhost:3306/prestogateway, user=root, password=root123, driver=com.mysql.cj.jdbc.Driver, queryHistoryHoursRetention=24), monitor=MonitorConfiguration(connectionTimeout=15, taskDelayMin=1), routingRules=RoutingRulesConfiguration(rulesEngineEnabled=false, rulesConfigPath=null), authentication=null, authorization=null, presetUsers={}, backendState=BackendStateConfiguration(username=lb_query, password=null, ssl=false))
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2218)
    at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5146)
    at com.google.inject.internal.util.StackTraceElements.forMember(StackTraceElements.java:70)
    at com.google.inject.internal.ProviderMethod.toString(ProviderMethod.java:209)
    at java.base/java.lang.String.valueOf(String.java:2951)
    at java.base/java.lang.StringBuilder.append(StringBuilder.java:172)
    at com.google.common.base.MoreObjects$ToStringHelper.toString(MoreObjects.java:350)
    at com.google.inject.internal.ProviderInstanceBindingImpl.toString(ProviderInstanceBindingImpl.java:106)
    at java.base/java.lang.String.valueOf(String.java:2951)
    at java.base/java.lang.StringBuilder.append(StringBuilder.java:172)
    at java.base/java.util.AbstractCollection.toString(AbstractCollection.java:473)
    at java.base/java.util.Collections$UnmodifiableCollection.toString(Collections.java:1040)
    at java.base/java.lang.String.valueOf(String.java:2951)
    at java.base/java.lang.StringBuilder.append(StringBuilder.java:172)
    at com.google.common.base.MoreObjects$ToStringHelper.toString(MoreObjects.java:350)
    at com.google.inject.internal.InjectorImpl.toString(InjectorImpl.java:1100)
    at com.lyft.data.baseapp.BaseApp.run(BaseApp.java:105)
    at com.lyft.data.baseapp.BaseApp.run(BaseApp.java:50)
    at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
    at io.dropwizard.cli.Cli.run(Cli.java:78)
    at io.dropwizard.Application.run(Application.java:93)
    at com.lyft.data.gateway.ha.HaGatewayLauncher.main(HaGatewayLauncher.java:25)
Caused by: java.lang.IllegalArgumentException
    at com.google.inject.internal.asm.$ClassReader.<init>(Unknown Source)
    at com.google.inject.internal.asm.$ClassReader.<init>(Unknown Source)
    at com.google.inject.internal.asm.$ClassReader.<init>(Unknown Source)
    at com.google.inject.internal.util.LineNumbers.<init>(LineNumbers.java:66)
    at com.google.inject.internal.util.StackTraceElements$1.load(StackTraceElements.java:46)
    at com.google.inject.internal.util.StackTraceElements$1.load(StackTraceElements.java:43)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212)
    ... 25 more
Disconnected from the target VM, address: 'localhost:12345', transport: 'socket'

Process finished with exit code 1

This is my run config

image

I'm able to run this project via

cd gateway-ha/target/
java -jar gateway-ha-{{VERSION}}-jar-with-dependencies.jar server ../gateway-ha-config.yml

However, this doesn't allow me to debug the project