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

Could not start the 4.0.0-beta1 container #1461

Closed
cobolbaby opened this issue Feb 5, 2024 · 3 comments
Closed

Could not start the 4.0.0-beta1 container #1461

cobolbaby opened this issue Feb 5, 2024 · 3 comments

Comments

@cobolbaby
Copy link
Contributor

cobolbaby commented Feb 5, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

version: "2.3"
services:
  worker:
    container_name: dkron
    hostname: dkron
    image: dkron/dkron:4.0.0-beta1-light
    restart: always
    cpu_count: 1
    mem_limit: 2g
    logging:
      driver: "json-file"
      options:
        max-size: 2m
    network_mode: host
    # environment:
    #   TZ: Asia/Shanghai
    volumes:
      # - dkron-resource:/opt/dkron-resource:rw
      - /etc/localtime:/etc/localtime:ro
      # - ./volume/dkron/data:/var/lib/dkron/data
      - /var/run/docker.sock:/var/run/docker.sock
    command: |
      agent
      --server
      --log-level debug
      --tag docker-cli=true
      --tag python=true
      --bind-addr localhost:6231
      --rpc-port 6232
      --enable-prometheus
      --disable-usage-stats
      --bootstrap-expect=1
      --http-addr :6230
      --data-dir /var/lib/dkron/data

# networks:
#   default:
#     external: true
#     name: infra

# volumes:
#   dkron-resource:      
#     name: dkron-resource
$ docker-compose up

Pulling worker (dkron/dkron:4.0.0-beta1-light)...
4.0.0-beta1-light: Pulling from dkron/dkron
4abcf2066143: Already exists
5b0ecaac30bf: Pull complete
5de4d443a3be: Pull complete
Recreating dkron ... done
Attaching to dkron
dkron     | time="2024-02-07T10:45:38+08:00" level=info msg="No valid config found: Applying default values." error="Config File \"dkron\" Not Found in \"[/etc/dkron /root/.dkron /config]\""
dkron     | time="2024-02-07T10:45:38+08:00" level=debug msg="starting plugin" args="[/usr/local/bin/dkron shell]" node=dkron path=/usr/local/bin/dkron
dkron     | time="2024-02-07T10:45:38+08:00" level=debug msg="plugin started" node=dkron path=/usr/local/bin/dkron pid=17
dkron     | time="2024-02-07T10:45:38+08:00" level=debug msg="waiting for RPC address" node=dkron plugin=/usr/local/bin/dkron
dkron     | time="2024-02-07T10:45:38+08:00" level=fatal msg="Unrecognized remote plugin message: time=\"2024-02-07T10:45:38+08:00\" level=info msg=\"No valid config found: Applying default values.\" error=\"Config File \\\"dkron\\\" Not Found in \\\"[/etc/dkron /root/.dkron /config]\\\"\"\nThis usually means\n  the plugin was not compiled for this architecture,\n  the plugin is missing dynamic-link libraries necessary to run,\n  the plugin is not executable by this process due to file permissions, or\n  the plugin failed to negotiate the initial go-plugin protocol handshake\n\nAdditional notes about plugin:\n  Path: /usr/local/bin/dkron\n  Mode: -rwxr-xr-x\n  Owner: 0 [root] (current: 0 [root])\n  Group: 0 [root] (current: 0 [root])\n  ELF architecture: EM_X86_64 (current architecture: amd64)\n"

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

Screenshots
If applicable, add screenshots to help explain your problem.

** Specifications:**

  • OS: [e.g. linux]
  • Version [e.g. 2.0.1]

Additional context
Add any other context about the problem here.

@vcastellm
Copy link
Member

Something look messed up with the binaries in the image, I'm checking

@cobolbaby
Copy link
Contributor Author

I'm wondering, why does a configuration initialization issue have an impact on the plugin's startup, causing this kind of error?

dkron/cmd/plugins.go

Lines 140 to 150 in c35d31e

// Request the RPC client so we can get the provider
// so we can build the actual RPC-implemented provider.
rpcClient, err := client.Client()
if err != nil {
return nil, err
}
raw, err := rpcClient.Dispense(pluginType)
if err != nil {
return nil, err
}

@vcastellm
Copy link
Member

Fixed in #1465

Yeah @cobolbaby, Dkron uses hashicorp/go-plugin, plugins are binaries that runs side by side the main process, as child processes, and communicates with the parent process using HTTP gRPC connection, in this case, the shell plugin is now embeded into the main Dkron binary as a subcommand, when that subcommand was being called, an extra info message was being output from the plugin, causing the go-plugin protocol to break and not understand what the binary was saying.

Hope it makes sense.

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

No branches or pull requests

2 participants