Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Same port bug and or bug behind kubernetes LB? #1108

Open
tarreislam opened this issue Jan 18, 2024 · 2 comments
Open

[BUG] Same port bug and or bug behind kubernetes LB? #1108

tarreislam opened this issue Jan 18, 2024 · 2 comments
Assignees
Labels
status:triage Awaiting triage.

Comments

@tarreislam
Copy link

Description
Connection refused when using the official quay.io/soketi/soketi:1-16-alpine in a kubernetes envoirment using LB

Reproduction steps
Create simple app with quay.io/soketi/soketi:1-16-alpine as image with the ports 9601 and 6001

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Every connection attempt to :6001 fails with "connection refused" whilst http://xxx:9601/usage and http://xxx:9601/ reports usage and "OK"

Environment

  • Soketi version (i.e. 1.3.0): quay.io/soketi/soketi:1-16-alpine
  • Adapter (local, redis): local
  • App Manager (array, mysql, postgres, dynamodb) : array
  • Queue (sqs, redis, sync): sync
  • Cache Managers (memory, redis): memory

Configuration
Run the server with SOKETI_DEBUG=1 and paste the nested object configuration that outputs:

{
  adapter: {
    driver: 'local',
    redis: {
      requestsTimeout: 5000,
      prefix: '',
      redisPubOptions: {},
      redisSubOptions: {},
      clusterMode: false
    },
    cluster: { requestsTimeout: 5000 },
    nats: {
      requestsTimeout: 5000,
      prefix: '',
      servers: [ '127.0.0.1:4222' ],
      user: null,
      pass: null,
      token: null,
      timeout: 10000,
      nodesNumber: null
    }
  },
  appManager: {
    driver: 'array',
    cache: { enabled: false, ttl: -1 },
    array: {
      apps: [
        {
          id: 'app-id',
          key: 'app-key',
          secret: 'app-secret',
          maxConnections: -1,
          enableClientMessages: false,
          enabled: true,
          maxBackendEventsPerSecond: -1,
          maxClientEventsPerSecond: -1,
          maxReadRequestsPerSecond: -1,
          webhooks: []
        }
      ]
    },
    dynamodb: { table: 'apps', region: 'us-east-1', endpoint: null },
    mysql: { table: 'apps', version: '8.0', useMysql2: false },
    postgres: { table: 'apps', version: '13.3' }
  },
  cache: { driver: 'memory', redis: { redisOptions: {}, clusterMode: false } },
  channelLimits: { maxNameLength: 200, cacheTtl: 3600 },
  cluster: {
    hostname: '0.0.0.0',
    helloInterval: 500,
    checkInterval: 500,
    nodeTimeout: 2000,
    masterTimeout: 2000,
    port: 11002,
    prefix: '',
    ignoreProcess: true,
    broadcast: '255.255.255.255',
    unicast: null,
    multicast: null
  },
  cors: {
    credentials: true,
    origin: [ '*' ],
    methods: [ 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS' ],
    allowedHeaders: [
      'Origin',
      'Content-Type',
      'X-Auth-Token',
      'X-Requested-With',
      'Accept',
      'Authorization',
      'X-CSRF-TOKEN',
      'XSRF-TOKEN',
      'X-Socket-Id'
    ]
  },
  database: {
    mysql: {
      host: '127.0.0.1',
      port: 3306,
      user: 'root',
      password: 'password',
      database: 'main'
    },
    postgres: {
      host: '127.0.0.1',
      port: 5432,
      user: 'postgres',
      password: 'password',
      database: 'main'
    },
    redis: {
      host: '127.0.0.1',
      port: 6379,
      db: 0,
      username: null,
      password: null,
      keyPrefix: '',
      sentinels: null,
      sentinelPassword: null,
      name: 'mymaster',
      clusterNodes: []
    }
  },
  databasePooling: { enabled: false, min: 0, max: 7 },
  debug: 1,
  eventLimits: {
    maxChannelsAtOnce: 100,
    maxNameLength: 200,
    maxPayloadInKb: 100,
    maxBatchSize: 10
  },
  host: '0.0.0.0',
  httpApi: { requestLimitInMb: 100, acceptTraffic: { memoryThreshold: 85 } },
  instance: { process_id: 1 },
  metrics: {
    enabled: false,
    driver: 'prometheus',
    host: '0.0.0.0',
    prometheus: { prefix: 'soketi_' },
    port: 9601
  },
  mode: 'full',
  port: 'tcp://10.100.93.253:6001',
  pathPrefix: '',
  presence: { maxMembersPerChannel: 100, maxMemberSizeInKb: 2 },
  queue: {
    driver: 'sync',
    redis: { concurrency: 1, redisOptions: {}, clusterMode: false },
    sqs: {
      region: 'us-east-1',
      endpoint: null,
      clientOptions: {},
      consumerOptions: {},
      queueUrl: '',
      processBatch: false,
      batchSize: 1,
      pollingWaitTimeMs: 0
    }
  },
  rateLimiter: { driver: 'local', redis: { redisOptions: {}, clusterMode: false } },
  shutdownGracePeriod: 3000,
  ssl: { certPath: '', keyPath: '', passphrase: '', caPath: '' },
  userAuthenticationTimeout: 30000,
  webhooks: { batching: { enabled: false, duration: 50 } }
}
  📡 soketi initialization....  
   Initializing the HTTP API & Websockets Server...  
   Initializing the Websocket listeners and channels...  
   Initializing the HTTP webserver...  
  🕵️‍♂️ Initiating metrics endpoints...  

   🎉 Server is up and running!   
   📡 The Websockets server is available at 127.0.0.1:tcp://10.100.93.253:6001   
   🔗 The HTTP API server is available at http://127.0.0.1:tcp://10.100.93.253:6001   
   🎊 The /usage endpoint is available on port 9601.   

(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
   [Wed Jan 17 2024 23:42:35 GMT+0000 (Coordinated Universal Time)] Promoted from node to master.   
{
  isMaster: true,
  isMasterEligible: true,
  weight: -0.1705534955103,
  address: '127.0.0.1',
  advertisement: undefined
}

Additional context

Locally it works without any problems

@tarreislam tarreislam added the status:triage Awaiting triage. label Jan 18, 2024
Copy link

codeautopilot bot commented Jan 18, 2024

Your organization has reached the subscribed usage limit. You can upgrade your plan at https://github.com/marketplace/code-autopilot-ai-coder

Disclaimer: This comment was entirely generated using AI. Be aware that the information provided may be incorrect.

Current plan usage: 102.04%

Have feedback or need help?
Discord
Documentation
support@codeautopilot.com

@tarreislam
Copy link
Author

I cant even do wget http://localhost:6001/ in the local pod

--2024-01-18 00:22:33--  (try: 3)  http://localhost:6001/
Connecting to localhost (localhost)|127.0.0.1|:6001... failed: Connection refused.
Connecting to localhost (localhost)|::1|:6001... failed: Cannot assign requested address.
Retrying.

will run soketi somewhere else meanwhile...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:triage Awaiting triage.
Development

No branches or pull requests

2 participants