Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

[Bug] Issues updating records within recent versions #92

Closed
1 task done
chrxmvtik opened this issue Jul 25, 2023 · 5 comments · Fixed by #93
Closed
1 task done

[Bug] Issues updating records within recent versions #92

chrxmvtik opened this issue Jul 25, 2023 · 5 comments · Fixed by #93

Comments

@chrxmvtik
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Version

3.2.3

Describe The Bug

Recent version crashes while trying to update records

 err: {
      "type": "CloudflareApiError",
      "message": "Api Error from Cloudflare. Errors: \n{\"code\":10000,\"message\":\"POST method not allowed for the api_token authentication scheme\"}",
      "stack":
          Error: Api Error from Cloudflare. Errors: 
          {"code":10000,"message":"POST method not allowed for the api_token authentication scheme"}
              at file:///app/packages/api/lib/create-api/index.js:38:19
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async update (file:///app/packages/app/lib/api.js:47:17)
              at async updateOrCreate (file:///app/packages/app/lib/api.js:85:20)
              at async updateDomain (file:///app/packages/app/lib/index.js:15:20)
              at async file:///app/packages/app/lib/index.js:44:28
              at async Promise.all (index 0)
              at async updateDnsRecords (file:///app/packages/app/lib/index.js:54:5)
              at async main (file:///app/packages/app/lib/index.js:74:9)
              at async file:///app/index.mjs:5:1
      "aggregateErrors": [
        {
          "type": "Object",
          "message": "POST method not allowed for the api_token authentication scheme",
          "stack":
              
          "code": 10000
        }
      ],
      "errors": [
        {
          "code": 10000,
          "message": "POST method not allowed for the api_token authentication scheme"
        }
      ]
    }

Steps To Reproduce

Use latest version (3.2.3) with config that worked before - works fine with 3.2.0.

Expected Behavior

No issue while sending a request to cloudflare.

YAML Configuration

No response

JS Configuration

No response

Relevant Output Log

No response

@joshuaavalon
Copy link
Owner

I cannot reproduce your issue, Please make sure you configuration and your permission of the API token is correct.

@chrxmvtik
Copy link
Author

I cannot reproduce your issue, Please make sure you configuration and your permission of the API token is correct.

apiVersion: v1
kind: ConfigMap
metadata:
  name: cloudflare-ddns-config
  namespace: cf
data:
  config.yaml: |
    api: https://api.cloudflare.com/client/v4/
    logLevel: info
    auth:
      scopedToken: XXXXXXXXXXXXXXXXXXXXXXX
    domains:
    - name: xxx.domain.a
      type: A
      proxied: true
      create: true
      zoneId: 23b4a2bb4cccxxxxxxxxxxxxxxxxxxxxx
    - name: xxx.xxx.domain.b
      type: A
      proxied: true
      create: true
      zoneId: a7c1f39f37895d33xxxxxxxxxxxxxxx
    - name: xxxx.domain.c
      type: A
      proxied: true
      create: true
      zoneId: a7c1f39f37895d331xxxxxxxxxxxxx
    ipv4:
    - type: ini
      url: https://1.1.1.1/cdn-cgi/trace
      fields:
      - ip
    - type: json
      url: https://api.ipify.org?format=json
      fields:
      - ip
    ipv6:
    - type: ini
      url: https://[2606:4700:4700::1111]/cdn-cgi/trace
      fields:
      - ip
    - type: json
      url: https://api6.ipify.org?format=json
      fields:
      - ip
    echoParsers:
    - resolve: "@cloudflare-ddns/ip-echo-parser-ini"
      alias: ini
    - resolve: "@cloudflare-ddns/ip-echo-parser-json"
      alias: json
    - resolve: "@cloudflare-ddns/ip-echo-parser-text"
      alias: text

My config is correct I am using mulitple domains, as I stated in the description of the issue when using version 3.2.0 there are no issues at all, but after upgrading to newer versions, issue appears.

@mike2307
Copy link

I can confirm that this also happens to me since updating to the latest version.
Using the tag 3.2.0 is a suitable workaround for me as well.

However I'm getting different errors on the 2 machines I'm using that container.

Scenario A:

err: {
  "type": "CloudflareApiError",
  "message": "Api Error from Cloudflare. Errors: \n{\"code\":10000,\"message\":\"POST method not allowed for the api_token authentication scheme\"}",
  "stack":
      Error: Api Error from Cloudflare. Errors: 
      {"code":10000,"message":"POST method not allowed for the api_token authentication scheme"}
          at file:///app/packages/api/lib/create-api/index.js:38:19
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async update (file:///app/packages/app/lib/api.js:47:17)
          at async updateOrCreate (file:///app/packages/app/lib/api.js:85:20)
          at async updateDomain (file:///app/packages/app/lib/index.js:15:20)
          at async file:///app/packages/app/lib/index.js:44:28
          at async Promise.all (index 0)
          at async updateDnsRecords (file:///app/packages/app/lib/index.js:54:5)
          at async main (file:///app/packages/app/lib/index.js:74:9)
          at async file:///app/index.mjs:5:1
  "aggregateErrors": [
    {
      "type": "Object",
      "message": "POST method not allowed for the api_token authentication scheme",
      "stack":
          
      "code": 10000
    }
  ],
  "errors": [
    {
      "code": 10000,
      "message": "POST method not allowed for the api_token authentication scheme"
    }
  ]
}

Scenario B:

err: {
  "type": "DOMException",
  "message": "The operation was aborted due to timeout",
  "stack":
      TimeoutError: The operation was aborted due to timeout
          at Object.fetch (node:internal/deps/undici/undici:11576:11)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async file:///app/packages/api/lib/create-api/index.js:24:21
          at async getDNSRecord (file:///app/packages/app/lib/api.js:31:17)
          at async updateDns (file:///app/packages/app/lib/api.js:99:23)
          at async updateDomain (file:///app/packages/app/lib/index.js:15:20)
          at async file:///app/packages/app/lib/index.js:44:28
          at async Promise.all (index 5)
          at async updateDnsRecords (file:///app/packages/app/lib/index.js:54:5)
          at async main (file:///app/packages/app/lib/index.js:74:9)
  "name": "TimeoutError",
  "code": 23,
  "INDEX_SIZE_ERR": 1,
  "DOMSTRING_SIZE_ERR": 2,
  "HIERARCHY_REQUEST_ERR": 3,
  "WRONG_DOCUMENT_ERR": 4,
  "INVALID_CHARACTER_ERR": 5,
  "NO_DATA_ALLOWED_ERR": 6,
  "NO_MODIFICATION_ALLOWED_ERR": 7,
  "NOT_FOUND_ERR": 8,
  "NOT_SUPPORTED_ERR": 9,
  "INUSE_ATTRIBUTE_ERR": 10,
  "INVALID_STATE_ERR": 11,
  "SYNTAX_ERR": 12,
  "INVALID_MODIFICATION_ERR": 13,
  "NAMESPACE_ERR": 14,
  "INVALID_ACCESS_ERR": 15,
  "VALIDATION_ERR": 16,
  "TYPE_MISMATCH_ERR": 17,
  "SECURITY_ERR": 18,
  "NETWORK_ERR": 19,
  "ABORT_ERR": 20,
  "URL_MISMATCH_ERR": 21,
  "QUOTA_EXCEEDED_ERR": 22,
  "TIMEOUT_ERR": 23,
  "INVALID_NODE_TYPE_ERR": 24,
  "DATA_CLONE_ERR": 25
}

@joshuaavalon
Copy link
Owner

joshuaavalon commented Jul 27, 2023

@mike2307

Scenario A

It should be fixed.

Scenario B

I have added an option in configuration for you to configure. It was added to try to solve #79. But you should take a look at your network since the default timeout is 5s.

@mike2307
Copy link

@joshuaavalon

Scenario A: works; thanks
Scenario B: works after configuring a timeout of 10000

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants