akamai / cli-sandbox

Akamai CLI for Sandbox
https://github.com/akamai/cli
Apache License 2.0
13 stars 12 forks source link

sandbox connector - 502 #112

Open Volt-hf opened 2 years ago

Volt-hf commented 2 years ago

Hi,

I'm having issues accessing the page run in sandbox. The property is using HSTS and SiteShield with allow-list on the origin side with CIDR's from Prod map and SS+Secure Edge Staging network.

Accessing the page gives me `sandbox connector - 502' and https does not work at all

❯ akamai sandbox create --edgerc ~/.edgerc --section default --property XXX --name sss1 --accountkey F-AC-XX --origin-from property
building origin list
Detected the following origins: XXX
registering sandbox in local datastore
sandbox-id: XXX xx is now active
Successfully created sandbox-id XXX Generated sandbox client configuration at /home/volt/.akamai-cli/cache/sandbox-cli/sandboxes/sss1/config.json Edit this file to specify the port and host for your dev environment.
❯ akamai sandbox start --print-logs
Starting Sandbox Client with arguments:
Config: /home/volt/.akamai-cli/cache/sandbox-cli/sandboxes/sss1/config.json
Logging path: /home/volt/.akamai-cli/cache/sandbox-cli/sandboxes/sss1/logs
Logging file: /home/volt/.akamai-cli/cache/sandbox-cli/sandboxes/sss1/logs/sandbox-client.log
Logging config: /home/volt/.akamai-cli/cache/sandbox-cli/sandbox-client-1.4.0-RELEASE/conf/logback.xml

Arguments: "/usr/lib/jvm/java-8-openjdk-amd64/bin/java",-DLOG_PATH="/home/volt/.akamai-cli/cache/sandbox-cli/sandboxes/sss1/logs",-DLOGGING_CONFIG_FILE="/home/volt/.akamai-cli/cache/sandbox-cli/sandbox-client-1.4.0-RELEASE/conf/logback.xml",-jar "/home/volt/.akamai-cli/cache/sandbox-cli/sandbox-client-1.4.0-RELEASE/lib/sandbox-client-1.4.0-RELEASE.jar",--config="/home/volt/.akamai-cli/cache/sandbox-cli/sandboxes/sss1/config.json",--spring.profiles.active=print-logs

2022-07-20 02:12:21 [main] INFO  c.a.devpops.connector.ConnectorMain - Starting ConnectorMain v1.4.0-RELEASE on pop-os with PID 417612 (/home/volt/.akamai-cli/cache/sandbox-cli/sandbox-client-1.4.0-RELEASE/lib/sandbox-client-1.4.0-RELEASE.jar started by volt in /home/volt)
2022-07-20 02:12:21 [main] INFO  c.a.devpops.connector.ConnectorMain - The following profiles are active: print-logs
2022-07-20 02:12:22 [main] INFO  c.a.d.c.service.OriginTargetService - parsing origin mappings
2022-07-20 02:12:23 [main] INFO  o.s.s.c.ThreadPoolTaskExecutor - Initializing ExecutorService 'taskExecutor'
2022-07-20 02:12:23 [main] INFO  c.a.devpops.connector.ConnectorMain - Started ConnectorMain in 1.887 seconds (JVM running for 3.015)
2022-07-20 02:12:23 [main] INFO  c.a.devpops.connector.ConnectorMain - Setting simple memory leak detector
2022-07-20 02:12:23 [main] INFO  c.a.devpops.connector.ConnectorMain - started internal channel - internalOriginRequestDispatcher
2022-07-20 02:12:23 [main] INFO  c.a.devpops.connector.ConnectorMain - starting HTTP 1.1 server
2022-07-20 02:12:23 [main] INFO  c.a.devpops.connector.ConnectorMain - started primary http channel
2022-07-20 02:12:23 [main] INFO  c.a.devpops.connector.ConnectorMain - Successfully launched Akamai Sandbox Client
2022-07-20 02:12:23 [main] INFO  c.a.devpops.connector.ConnectorMain - Sandbox Client running on port: 9550

Accessing with HTTP

2022-07-20 02:20:55 [nioEventLoopGroup-2-3] INFO  requests - GET /
2022-07-20 02:20:55 [nioEventLoopGroup-2-3] INFO  c.a.d.c.server.TunnelChannelFactory - building new tunnel
2022-07-20 02:20:55 [nioEventLoopGroup-2-3] INFO  c.a.d.c.server.TunnelChannelFactory - Opening connection to gateway: wss://sandbox-gateway.akamai.com:443/XXX/websocket
2022-07-20 02:20:55 [nioEventLoopGroup-2-3] INFO  c.a.d.c.server.TunnelChannelFactory - connecting to gateway
2022-07-20 02:20:56 [nioEventLoopGroup-2-3] INFO  c.a.d.c.server.TunnelChannelFactory - waiting for secure web socket handshake
2022-07-20 02:20:58 [nioEventLoopGroup-3-2] INFO  c.a.d.c.s.GatewayWebsocketClientHandler - WebSocket Client connected!
2022-07-20 02:20:58 [nioEventLoopGroup-2-3] INFO  c.a.d.c.server.TunnelChannelFactory - completed web sockets handshake
2022-07-20 02:21:35 [nioEventLoopGroup-2-4] ERROR c.a.d.c.server.OriginRequestHandler - Failed to connect to outbound proxy channel for target = OriginTarget{secure=true, port=443, host='XXX'}
2022-07-20 02:24:36 [nioEventLoopGroup-3-2] INFO  c.a.d.c.s.GatewayWebsocketClientHandler - WebSocket Client disconnected!

Accessing with HTTPS

2022-07-20 02:36:28 [nioEventLoopGroup-2-5] INFO  requests - GET /bad-request
2022-07-20 02:36:28 [nioEventLoopGroup-2-5] ERROR c.a.d.c.s.ConnectorUserRequestHandler - got error: {}
java.lang.NullPointerException: null
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:878)
    at com.google.common.net.HostAndPort.fromString(HostAndPort.java:166)
    at com.akamai.devpops.connector.util.RequestUtils.stripPortFromHostHeader(RequestUtils.java:25)
    at com.akamai.devpops.connector.service.RequestXFormServiceImpl.prepareRequestForGateway(RequestXFormServiceImpl.java:30)
    at com.akamai.devpops.connector.server.ConnectorUserRequestHandler.channelRead(ConnectorUserRequestHandler.java:186)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

Can there be something with the property settings/origin that prevents the requests going to origin or something might be wrong/missing for my local setup?

ksnehi commented 9 months ago

Hi @Volt-hf Did you get any support from Akamai on this? If so, would you mind sharing the insights, facing exactly the same problem.

Volt-hf commented 9 months ago

Hi @Volt-hf Did you get any support from Akamai on this? If so, would you mind sharing the insights, facing exactly the same problem.

No, but using the official Docker seems more stable for sandbox.

leanjunio commented 3 months ago

Hi @Volt-hf Did you get any support from Akamai on this? If so, would you mind sharing the insights, facing exactly the same problem.

Hi @ksnehi, any luck on your end?