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

Problem running NATS service in GitHub Actions #169

Open
diogobaeder opened this issue Jul 9, 2024 · 1 comment
Open

Problem running NATS service in GitHub Actions #169

diogobaeder opened this issue Jul 9, 2024 · 1 comment

Comments

@diogobaeder
Copy link

Hi folks,

I'm trying to run NATS as a service in GitHub Actions, but I can't get it to run correctly somehow. Here's how I'm running it, with a few health check options that I added after I noticed that the service was unreachable:

      nats:
        image: nats
        options: >-
          --health-cmd "nats account info"
          --health-interval 2s
          --health-timeout 2s
          --health-retries 2
        ports:
          - 4222:4222
          - 6222:6222
          - 8222:8222

Does anyone spot anything wrong with the block above? Even if I leave out the health check, I just can't access it using hostname nats, and with the health check it just fails hard when spawning the container.

Thanks!

@lneoe
Copy link

lneoe commented Sep 25, 2024

I encountered the same problem too, part of my workflow config was

jobs:
  test:
    runs-on: ubuntu-latest
    service:
      jetstream:
        image: nats

I can see the server start log in action log, but I can't connect nats server with nats://jetstream:4222, my program panic with test panicked: dial tcp: lookup jetstream on 127.0.0.53:53: server misbehaving

   [1] 2024/09/25 14:20:35.906689 [INF] Starting nats-server
   [1] 2024/09/25 14:20:35.906893 [INF]   Version:  2.10.20
   [1] 2024/09/25 14:20:35.906923 [INF]   Git:      [7140387]
   [1] 2024/09/25 14:20:35.906963 [INF]   Cluster:  my_cluster
   [1] 2024/09/25 14:20:35.906991 [INF]   Name:     NCQCY5SLGQJ5KGAB5TF5L55NSCWZPVQSHMK2WGIVPI6RDIWFHEEH32DP
   [1] 2024/09/25 14:20:35.907009 [INF]   ID:       NCQCY5SLGQJ5KGAB5TF5L55NSCWZPVQSHMK2WGIVPI6RDIWFHEEH32DP
   [1] 2024/09/25 14:20:35.907037 [INF] Using configuration file: nats-server.conf
   [1] 2024/09/25 14:20:35.907997 [INF] Starting http monitor on 0.0.0.0:8222
   [1] 2024/09/25 14:20:35.908361 [INF] Listening for client connections on 0.0.0.0:4222
   [1] 2024/09/25 14:20:35.908609 [INF] Server is ready
   [1] 2024/09/25 14:20:35.908723 [INF] Cluster name is my_cluster
   [1] 2024/09/25 14:20:35.908948 [INF] Listening for route connections on 0.0.0.0:6222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants