distribworks / dkron

Dkron - Distributed, fault tolerant job scheduling system https://dkron.io
GNU Lesser General Public License v3.0
4.31k stars 384 forks source link

Docker volumes not working, after restart get: "failed to build resolver: passthrough: received empty target in Build()" while trying to insert a job #1497

Open gfolcarelli opened 8 months ago

gfolcarelli commented 8 months ago

Describe the bug I can't insert a new job via Postman after recreating a docker container built up with docker-compose and volumes. I get error "failed to build resolver: passthrough: received empty target in Build()" I'm in linux environment, in windows environment I get: "context deadline exceeded"

If I comment the volumes part in the docker compose it works correctly (but obviously doesn't store the jobs after container restart).

To Reproduce This is docker-compose.yml

version: "3.3"

services:

  dkron:
    image: dkron/dkron
    restart: always
    ports:
      - 8080:8080
      - 8946:8946
    command: agent --server --log-level=debug --bootstrap-expect=1 --data-dir=/dkron.data
    volumes:
      - ./dkron.data:/dkron.data

cmd: docker compose up -d

run via postman this api:

POST http://localhost:8080/v1/jobs

Body:

{
    "name": "try",
    "displayname": "",
    "schedule": "0 0 6 * * *",
    "timezone": "UTC",
    "owner": "try",
    "owner_email": "",
    "disabled": false,
    "tags": {
        "server": "true"
    },
    "retries": 0,
    "parent_job": "",
    "processors": {
        "log": {
            "forward": "true"
        }
    },
    "concurrency": "",
    "executor": "http",
    "executor_config": {
        "method": "GET",
        "url": "https://try.try.try",
        "headers": "",
        "body": "",
        "timeout": "30",
        "expectCode": "200",
        "expectBody": "",
        "debug": "false"
    }
}

It goes well and the api job is uploaded. After do cmd: docker compose down && docker compose up -d

There is no job inside the stored jobs (strange).

Then I try to insert it again and get the errors: "failed to build resolver: passthrough: received empty target in Build()" in linux "context deadline exceeded" in windows

Expected behavior I expected to find the jobs still inside the already created jobs, and anyway no errors trying to insert them again.

Michael62501 commented 4 months ago

I have meet the same problem with you. I find the error log occur because not find the node id. So I decide to set the fix node name, then I resolve my problem. you can see this: https://dkron.io/docs/cli/dkron_agent/ Add the param --node-name to fix your node name

ngocdd commented 3 days ago

I got the same problem, setting the node-name didn't help me resolve it