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]: ftmetric service restarts | connection refused (docker) #35

Closed
fgrosswig opened this issue Oct 17, 2021 · 8 comments
Closed

[BUG]: ftmetric service restarts | connection refused (docker) #35

fgrosswig opened this issue Oct 17, 2021 · 8 comments
Labels
Module: metric Monorepo (FTMetric) Type: bug Something isn't working

Comments

@fgrosswig
Copy link

fgrosswig commented Oct 17, 2021

the metric service cant connect to freqtrade service port 8080:

Get "http://localhost:8080/api/v1/ping": dial tcp 127.0.0.1:8080: connect: connection refused

Connecting myself to the given adress i can get the "pong" result from the API.

curl http://localhost:8080/api/v1/ping
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    17  100    17    0     0   4406      0 --:--:-- --:--:-- --:--:--  5666

{"status":"pong"}

is the service really looking not "inside" due to 127.0.0.1 ??? so i also tried with my client adress since running freqtrade on my local machine but my config looks like:

"api_server": {
        "enabled": true,
        "listen_ip_address": "0.0.0.0",
        "listen_port": 8080,
        "verbosity": "error",
        "enable_openapi": false,
        "jwt_secret_key": "STRONG KEY",
        "CORS_origins": ["http://127.0.0.1","http://192.x.x.x","http://localhost","http://192.x.x.y"],
        "username": "username",
        "password": "password"
    },
22:24:00 client:db            [ERROR] | error: failed to connect to `host=localhost user= database=freqtrade`: dial error (dial tcp [::1]:5432: connect: cannot assign requested address)
panic: found '1' errors (total=2)
- Get "http://localhost:8080/api/v1/ping": dial tcp 127.0.0.1:8080: connect: connection refused


goroutine 1 [running]:
main.defaultCommand(0xc0000b49b0, 0x203000, 0xc00009f060)
        /home/runner/work/fthelper/fthelper/metric/main.go:55 +0x81a
github.com/kamontat/fthelper/shared/commandline/commands.(*Command).Start(0xc00009e320, 0xc0000b49b0, 0x2, 0xc00009f060)
        /home/runner/work/fthelper/fthelper/shared/commandline/commands/command.go:27 +0x5a
github.com/kamontat/fthelper/shared/commandline.(*cli).Start(0xc0000c4500, 0xc00001e0a0, 0x5, 0x5, 0xc000094568, 0xc00009c930)
        /home/runner/work/fthelper/fthelper/shared/commandline/cli.go:87 +0x9b2
main.main()
        /home/runner/work/fthelper/fthelper/metric/main.go:97 +0x477

docker inspect:

"Id": "41f243ac5e59b5f4fc055f431945b28a47e076fec68f23c785b8c936be0d324a",
    "Created": "2021-10-17T22:25:43.609797739Z",
    "Path": "/fth/ftmetric",
    "Args": [
        "--pwd",
        "/fth",
        "--envs",
        "/fth/.env.docker"
    ],
    "State": {
        "Status": "restarting",
        "Running": true,
        "Paused": false,
        "Restarting": true,
        "OOMKilled": false,
        "Dead": false,
        "Pid": 0,
        "ExitCode": 2,
        "Error": "",
        "StartedAt": "2021-10-17T22:26:48.935172108Z",
        "FinishedAt": "2021-10-17T22:26:48.953706053Z",
        "Health": {
            "Status": "unhealthy",
            "FailingStreak": 0,
            "Log": []
        }
    },
    "Image": "sha256:b700bffaf79d67e0da292e590f7dd0220d678e6d644ef724871fa8fcb03efdde",
    "ResolvConfPath": "/var/lib/docker/containers/41f243ac5e59b5f4fc055f431945b28a47e076fec68f23c785b8c936be0d324a/resolv.conf",
    "HostnamePath": "/var/lib/docker/containers/41f243ac5e59b5f4fc055f431945b28a47e076fec68f23c785b8c936be0d324a/hostname",
    "HostsPath": "/var/lib/docker/containers/41f243ac5e59b5f4fc055f431945b28a47e076fec68f23c785b8c936be0d324a/hosts",
    "LogPath": "/var/lib/docker/containers/41f243ac5e59b5f4fc055f431945b28a47e076fec68f23c785b8c936be0d324a/41f243ac5e59b5f4fc055f431945b28a47e076fec68f23c785b8c936be0d324a-json.log",
    "Name": "/ftmetric",
    "RestartCount": 10,
    "Driver": "overlay2",
    "Platform": "linux",
    "MountLabel": "",
    "ProcessLabel": "",
    "AppArmorProfile": "",
    "ExecIDs": null,
    "HostConfig": {
        "Binds": [],
        "ContainerIDFile": "",
        "LogConfig": {
            "Type": "json-file",
            "Config": {}
        },
        "NetworkMode": "ft_userdata_default",
        "PortBindings": {},
        "RestartPolicy": {
            "Name": "on-failure",
            "MaximumRetryCount": 0
        },
        "AutoRemove": false,
        "VolumeDriver": "",
        "VolumesFrom": null,
        "CapAdd": null,
        "CapDrop": null,
        "CgroupnsMode": "host",
        "Dns": null,
        "DnsOptions": null,
        "DnsSearch": null,
        "ExtraHosts": null,
        "GroupAdd": null,
        "IpcMode": "private",
        "Cgroup": "",
        "Links": null,
        "OomScoreAdj": 0,
        "PidMode": "",
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyRootfs": false,
        "SecurityOpt": null,
        "UTSMode": "",
        "UsernsMode": "",
        "ShmSize": 67108864,
        "Runtime": "runc",
        "ConsoleSize": [
            0,
            0
        ],
        "Isolation": "",
        "CpuShares": 0,
        "Memory": 0,
        "NanoCpus": 0,
        "CgroupParent": "",
        "BlkioWeight": 0,
        "BlkioWeightDevice": null,
        "BlkioDeviceReadBps": null,
        "BlkioDeviceWriteBps": null,
        "BlkioDeviceReadIOps": null,
        "BlkioDeviceWriteIOps": null,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "Devices": null,
        "DeviceCgroupRules": null,
        "DeviceRequests": null,
        "KernelMemory": 0,
        "KernelMemoryTCP": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "MemorySwappiness": null,
        "OomKillDisable": false,
        "PidsLimit": null,
        "Ulimits": null,
        "CpuCount": 0,
        "CpuPercent": 0,
        "IOMaximumIOps": 0,
        "IOMaximumBandwidth": 0,
        "MaskedPaths": [
            "/proc/asound",
            "/proc/acpi",
            "/proc/kcore",
            "/proc/keys",
            "/proc/latency_stats",
            "/proc/timer_list",
            "/proc/timer_stats",
            "/proc/sched_debug",
            "/proc/scsi",
            "/sys/firmware"
        ],
        "ReadonlyPaths": [
            "/proc/bus",
            "/proc/fs",
            "/proc/irq",
            "/proc/sys",
            "/proc/sysrq-trigger"
        ]
    },
    "GraphDriver": {
        "Data": {
            "LowerDir": "/var/lib/docker/overlay2/9263036bfcae0acc7bc54da75a8311bdd675b21cb69718108b2f8cad632cdd3f-init/diff:/var/lib/docker/overlay2/0767a8a8ff74895307bbf27cc86b0d7ee3cbaa8268d0c0a913945f751402d431/diff:/var/lib/docker/overlay2/ca9e3451d87329849ba44ac450cde79db54715ca8dbb26e37f8e0f83ec1f6843/diff:/var/lib/docker/overlay2/c6b495106ad2d9f8e2136cac22a1315bc9c688ed12e28e5c68b7ec63abdabd34/diff:/var/lib/docker/overlay2/ba877a38c09c65d784390c739daf02afbd66e82b3419ad4171ee3b7df84c8d8b/diff",
            "MergedDir": "/var/lib/docker/overlay2/9263036bfcae0acc7bc54da75a8311bdd675b21cb69718108b2f8cad632cdd3f/merged",
            "UpperDir": "/var/lib/docker/overlay2/9263036bfcae0acc7bc54da75a8311bdd675b21cb69718108b2f8cad632cdd3f/diff",
            "WorkDir": "/var/lib/docker/overlay2/9263036bfcae0acc7bc54da75a8311bdd675b21cb69718108b2f8cad632cdd3f/work"
        },
        "Name": "overlay2"
    },
    "Mounts": [],
    "Config": {
        "Hostname": "41f243ac5e59",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": true,
        "AttachStderr": true,
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
            "FTH_FREQTRADE__PASSWORD=password",
            "FTH_FREQTRADE__URL=http://freqtrade:8080",
            "FTH_FREQTRADE__USERNAME=username",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": null,
        "Healthcheck": {
            "Test": [
                "CMD",
                "wget",
                "--no-verbose",
                "--tries=1",
                "--spider",
                "http://localhost:8090/version"
            ],
            "Interval": 60000000000,
            "Timeout": 1000000000,
            "StartPeriod": 15000000000,
            "Retries": 3
        },
        "Image": "ghcr.io/kamontat/ftmetric",
        "Volumes": null,
        "WorkingDir": "/fth",
        "Entrypoint": [
            "/fth/ftmetric",
            "--pwd",
            "/fth",
            "--envs",
            "/fth/.env.docker"
        ],
        "OnBuild": null,
        "Labels": {
            "com.docker.compose.config-hash": "1d6dfce3ecf90d5ab9a1c3500551c4e1ac294a07d375bb21f5d69f4a67b07eef",
            "com.docker.compose.container-number": "1",
            "com.docker.compose.depends_on": "freqtrade",
            "com.docker.compose.image": "sha256:b700bffaf79d67e0da292e590f7dd0220d678e6d644ef724871fa8fcb03efdde",
            "com.docker.compose.oneoff": "False",
            "com.docker.compose.project": "ft_userdata",
            "com.docker.compose.project.config_files": "D:\\freqtrade\\ft_userdata\\docker-compose.yml",
            "com.docker.compose.project.working_dir": "D:\\freqtrade\\ft_userdata",
            "com.docker.compose.service": "ftmetric",
            "com.docker.compose.version": "2.0.0",
            "org.opencontainers.image.created": "2021-09-20T15:45:49Z",
            "org.opencontainers.image.revision": "9a02bd3fbed0bb82e7ad949701e26aa66ae2e23d",
            "org.opencontainers.image.tag": "v5.0.0-beta.14",
            "org.opencontainers.image.title": "ftmetric",
            "org.opencontainers.image.version": "5.0.0-beta.14"
        }
    },
    "NetworkSettings": {
        "Bridge": "",
        "SandboxID": "5d8cfddde2f2fbfadd025593b39bea23ee4b0e9e1c5565c803eb2b21e574d84a",
        "HairpinMode": false,
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "Ports": {},
        "SandboxKey": "/var/run/docker/netns/5d8cfddde2f2",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null,
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "MacAddress": "",
        "Networks": {
            "ft_userdata_default": {
                "IPAMConfig": null,
                "Links": null,
                "Aliases": [
                    "ftmetric",
                    "ftmetric",
                    "41f243ac5e59"
                ],
                "NetworkID": "0baeeccd8042ce6337b657261033ef05a06a441b9f2ac8a4822b8ed6b53b4123",
                "EndpointID": "",
                "Gateway": "",
                "IPAddress": "",
                "IPPrefixLen": 0,
                "IPv6Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "MacAddress": "",
                "DriverOpts": null
            }
        }
    },
    "CreatedTime": 1634509543609
}
goroutine 1 [running]:
main.defaultCommand(0xc00001eaa0, 0x203000, 0xc00002d180)
        /home/runner/work/fthelper/fthelper/metric/main.go:55 +0x81a
github.com/kamontat/fthelper/shared/commandline/commands.(*Command).Start(0xc00002c360, 0xc00001eaa0, 0x2, 0xc00002d180)
        /home/runner/work/fthelper/fthelper/shared/commandline/commands/command.go:27 +0x5a
github.com/kamontat/fthelper/shared/commandline.(*cli).Start(0xc000184500, 0xc0000b2000, 0x5, 0x5, 0xc000068498, 0xc000052930)
        /home/runner/work/fthelper/fthelper/shared/commandline/cli.go:87 +0x9b2
main.main()
        /home/runner/work/fthelper/fthelper/metric/main.go:97 +0x477
23:00:27 command:default      [INFO ] | [with-cache] Connection cluster ''
  http     - http://localhost:8080 ':'
  database - localhost:5432 (postgres) ':'
23:00:27 client:http          [DEBUG] | request: GET http://localhost:8080/api/v1/ping
23:00:27 cache:service        [DEBUG] | creating 'http.total-call' data
23:00:27 client:http          [DEBUG] | error: Get "http://localhost:8080/api/v1/ping": dial tcp 127.0.0.1:8080: connect: connection refused
23:00:27 cache:service        [DEBUG] | creating 'http.failure-call' data
23:00:27 client:db            [ERROR] | error: failed to connect to `host=localhost user= database=freqtrade`: dial error (dial tcp [::1]:5432: connect: cannot assign requested address)
panic: found '1' errors (total=2)
- Get "http://localhost:8080/api/v1/ping": dial tcp 127.0.0.1:8080: connect: connection refused

@fgrosswig
Copy link
Author

fgrosswig commented Oct 17, 2021

So it turns out that the ENV VARS still has to be named as follow:

FTH_FREQTRADE__HTTP__URL=

But i am receiving errors due to CORS (?) enabled config.

goroutine 1 [running]:
main.defaultCommand(0xc00001e9b0, 0x203000, 0xc00002ed60)
        /home/runner/work/fthelper/fthelper/metric/main.go:55 +0x81a
github.com/kamontat/fthelper/shared/commandline/commands.(*Command).Start(0xc00002e360, 0xc00001e9b0, 0x2, 0xc00002ed60)
        /home/runner/work/fthelper/fthelper/shared/commandline/commands/command.go:27 +0x5a
github.com/kamontat/fthelper/shared/commandline.(*cli).Start(0xc000208500, 0xc0000b2000, 0x5, 0x5, 0xc00006a568, 0xc000054930)
        /home/runner/work/fthelper/fthelper/shared/commandline/cli.go:87 +0x9b2
main.main()
        /home/runner/work/fthelper/fthelper/metric/main.go:97 +0x477
23:45:35 command:default      [INFO ] | [with-cache] Connection cluster ''
  http     - http://xxx.xxx.xxx.xxx:8080 'username:pas*******z'
  database - disabled
23:45:35 client:http          [DEBUG] | request: GET http://xxx.xxx.xxx.xxx::8080/api/v1/ping
23:45:35 cache:service        [DEBUG] | creating 'http.total-call' data
23:45:35 cache:service        [DEBUG] | creating 'http.success-call' data
23:45:35 client:db            [DEBUG] | not initial database because it disabled
23:45:35 command:default      [INFO ] | warmup process: true (interval=30s)
23:45:35 command:default      [INFO ] | Start server at http://localhost:8090
23:46:05 command:default      [DEBUG] | warmup freqtrade cluster 
23:46:05 client:http          [DEBUG] | request: GET http://xxx.xxx.xxx.xxx:8080/api/v1/whitelist
23:46:05 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:46:05 cache:service        [DEBUG] | creating 'http.failure-call' data
23:46:05 client:http          [DEBUG] | request: GET http://xxx.xxx.xxx.xxx:8080/api/v1/performance
23:46:05 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:46:05 client:http          [DEBUG] | request: GET http://xxx.xxx.xxx.xxx:8080/api/v1/balance
23:46:05 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:46:05 client:http          [DEBUG] | found request query for logs: 'limit=100'

and wirth service name url

23:51:00 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/ping
23:51:00 cache:service        [DEBUG] | creating 'http.total-call' data
23:51:00 cache:service        [DEBUG] | creating 'http.success-call' data
23:51:00 client:db            [DEBUG] | not initial database because it disabled
23:51:00 command:default      [INFO ] | warmup process: true (interval=30s)
23:51:00 command:default      [INFO ] | Start server at http://localhost:8090
23:51:30 command:default      [DEBUG] | warmup freqtrade cluster 
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/version
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 cache:service        [DEBUG] | creating 'http.failure-call' data
23:51:30 client:http          [DEBUG] | found request query for logs: 'limit=100'
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/logs?limit=100
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/show_config
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/locks
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/ping
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/balance
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/stats
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/count
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/whitelist
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/performance
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 client:http          [DEBUG] | request: GET http://freqtrade:8080/api/v1/profit
23:51:30 client:http          [DEBUG] | error: freqtrade () return error (status 401 Unauthorized)
23:51:30 cache:service        [DEBUG] | creating 'warmup.success.rate' data

@kamontat kamontat added Module: metric Monorepo (FTMetric) Type: bug Something isn't working labels Oct 18, 2021
@kamontat
Copy link
Owner

Could you provide docker-compose.yml that you use?

@fgrosswig
Copy link
Author

fgrosswig commented Oct 18, 2021

---
version: '3'
volumes:
  grafana-data:
  prometheus-data:
services:
  freqtrade:
    image: freqtradeorg/freqtrade:stable
    # image: freqtradeorg/freqtrade:develop
    #  Use plotting image
    #  image: freqtradeorg/freqtrade:develop_plot
    # Build step - only needed when additional dependencies are needed
    #  build:
    #   context: .
    #   dockerfile: "./Dockerfile"
    restart: unless-stopped
    container_name: freqtrade
    volumes:
      - "./user_data:/freqtrade/user_data"
      - "./secret:/freqtrade/secret"
    # Expose api on port 8080 (localhost only)
    # Please read the https://www.freqtrade.io/en/latest/rest-api/ documentation
    # before enabling this.
    ports:
      - "8080:8080"
    # Default command used when running `docker compose up`
    command: >
      trade 
      --logfile /freqtrade/user_data/logs/freqtrade.log
      --config /freqtrade/user_data/config.json
      --config /freqtrade/secret/secret.json
      --datadir /freqtrade/user_data/data/binance
      --db-url sqlite:////freqtrade/user_data/tradesv3.sqlite
      --strategy SampleStrategy
    healthcheck:
      test: ["CMD-SHELL", "python3 /freqtrade/scripts/rest_client.py --config /freqtrade/user_data/config.json | grep -q pong"]
      interval: 30s
      timeout: 4s
      retries: 3
      start_period: 1m
  ftmetric:
    # TODO: recommend to specify version `ghcr.io/kamontat/ftmetric:vX.X.X`
    image: ghcr.io/kamontat/ftmetric
    container_name: ftmetric
    restart: on-failure
    environment:
      - FTH_INTERNAL__LOG__LEVEL=5 
      - FTH_FREQTRADE__DB__ENABLED=false
      - FTH_FREQTRADE__HTTP__URL=http://freqtrade:8080
      - FTH_FREQTRADE__HTTP__USERNAME=username
      - FTH_FREQTRADE__HTTP__PASSWORD=password      
    depends_on:
      - freqtrade
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8090/version"]
      interval: 1m
      timeout: 1s
      retries: 3
      start_period: 15s
  prometheus:
    image: prom/prometheus:v2.28.0
    restart: on-failure
    # be aware before open the port
    # ports:
    #   - 9090:9090
    volumes:
      # TODO: add configuration at prometheus/prometheus.yml
      # - ./prometheus:/etc/prometheus/
      - prometheus-data:/prometheus
    command:
      - "--config.file=/etc/prometheus/prometheus.yml"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090/-/healthy"]
      interval: 1m
      timeout: 1s
      retries: 3
      start_period: 15s
  grafana:
    image: grafana/grafana:8.0.3
    container_name: grafana
    restart: on-failure
    ports:
      - 3000:3000
    depends_on:
      - freqtrade
      - prometheus
    volumes:
      - prometheus-data:/prometheus
    environment:
      ## override server url
      # - GF_SERVER_ROOT_URL=http://example.com
      - GF_SERVER_HTTP_PORT=3000
      ## enabled grafana beta alert manager
      # - GF_FEATURE_TOGGLES_ENABLE=ngalert
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=admin
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
      interval: 1m
      timeout: 1s
      retries: 3
      start_period: 15s

snipped from config.json of freqtrade:

"api_server": {
        "enabled": true,
        "listen_ip_address": "0.0.0.0",
        "listen_port": 8080,
        "verbosity": "error",
        "enable_openapi": true,
        "jwt_secret_key": "SOMESECRETKEY",
        "CORS_origins": ["http://127.0.0.1","http://192.xxx.xxx.xxx","http://localhost","http://192.xxx.xxx.xxy"],
        "username": "username",
        "password": "password"
    },

the info of the feqtrade container shows 401:

2021-10-18 14:16:34,767 - uvicorn.access - INFO - 172.26.0.8:48928 - "GET /api/v1/version HTTP/1.1" 401
2021-10-18 14:16:34,770 - uvicorn.access - INFO - 172.26.0.8:48930 - "GET /api/v1/balance HTTP/1.1" 401
2021-10-18 14:16:34,773 - uvicorn.access - INFO - 172.26.0.8:48932 - "GET /api/v1/show_config HTTP/1.1" 401
2021-10-18 14:16:34,775 - uvicorn.access - INFO - 172.26.0.8:48934 - "GET /api/v1/locks HTTP/1.1" 401
2021-10-18 14:16:34,778 - uvicorn.access - INFO - 172.26.0.8:48936 - "GET /api/v1/stats HTTP/1.1" 401

@kamontat
Copy link
Owner

  1. FTH_FREQTRADE__HTTP__URL is a new configuration format for v5+ so yes, if you using v5+ you should use this config
  2. Logging level didn't have level 5, the maximum level is 4. I will add some error to tell user later.
  3. I think actual problem should come from 401 Unauthorized. Did you make sure that your username and password is correct?

@fgrosswig
Copy link
Author

i am pretty sure the username and password are correct.

The enviroment meets the same criteria.

FTH_FREQTRADE__CLUSTER=1A
HOSTNAME=2c01e060736b
SHLVL=1
FTH_FREQTRADE__HTTP__PASSWORD=password
HOME=/root
FTH_SERVER__PORT=8090
FTH_FREQTRADE__HTTP__URL=http://freqtrade:8080
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
FTH_INTERNAL__LOG__LEVEL=5
FTH_FREQTRADE__HTTP__USERNAME=username
PWD=/fth

@kamontat
Copy link
Owner

Did this log show username:password correctly?

23:45:35 command:default      [INFO ] | [with-cache] Connection cluster ''
  http     - http://xxx.xxx.xxx.xxx:8080 'username:pas*******z'
  database - disabled

@kamontat
Copy link
Owner

I'm not able to reproduce your error. I already use your docker-compose.

CleanShot 2021-10-19 at 22 44 10@2x

If you certain about your username and password. Could you use this docker-compose.yml and this config.json.
If it show correct data, then modify base on your needs.

@fgrosswig
Copy link
Author

fgrosswig commented Oct 19, 2021

ok i can confirm thats a password issue. I followed the documentation by docker if you have $ in your password to quote them with $$.

example: Super$secure => needs to be quoted in docker: Super$$ecure to receive the password. That brought the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: metric Monorepo (FTMetric) Type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants