[Bug]: JSON Parsing Error with edge-alpine #1941

Closed
opened 2026-02-28 19:59:13 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @chrismilson on GitHub (Mar 7, 2025).

Originally assigned to: @lelemm on GitHub.

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

I am using the digest sha256:e01806d1bcb53f1b2c0a5252b96a00c0d46a5acf60bddc9d88a166c6aa4cbd96 that was released 7 minutes ago.

I deploy in Kubernetes and I have a configmap, that mounts a file into /config/config.json, and I set the ACTUAL_CONFIG_PATH environment variable to /config/config.json.

The content of the json file is:

{"openId":{"authMethod":"oauth2","client_id":"actualbudget","client_secret":"","issuer":"https://login.example.com/context/path","server_hostname":"https://actual.example.com"}}   

I get the following error when the pod starts:

undefined:1
https://login.example.com/context/path
^

SyntaxError: Unexpected token h in JSON at position 0
    at JSON.parse (<anonymous>)
    at coerce (/app/node_modules/convict/src/main.js:415:29)
    at /app/node_modules/convict/src/main.js:359:15
    at Array.forEach (<anonymous>)
    at overlay (/app/node_modules/convict/src/main.js:356:21)
    at /app/node_modules/convict/src/main.js:364:7
    at Array.forEach (<anonymous>)
    at overlay (/app/node_modules/convict/src/main.js:356:21)
    at /app/node_modules/convict/src/main.js:602:11
    at Array.forEach (<anonymous>)

Node.js v18.20.1

And then the pod exits.

How can we reproduce the issue?

Create a file config.json locally with the content above.

podman run -v .:/config -e ACTUAL_CONFIG_PATH=/config/config.json ghcr.io/actualbudget/actual@sha256:e01806d1bcb53f1b2c0a5252b96a00c0d46a5acf60bddc9d88a166c6aa4cbd96

Where are you hosting Actual?

Other

What browsers are you seeing the problem on?

Safari, Firefox

Operating System

Linux

Originally created by @chrismilson on GitHub (Mar 7, 2025). Originally assigned to: @lelemm on GitHub. ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? I am using the digest sha256:e01806d1bcb53f1b2c0a5252b96a00c0d46a5acf60bddc9d88a166c6aa4cbd96 that was released 7 minutes ago. I deploy in Kubernetes and I have a configmap, that mounts a file into /config/config.json, and I set the ACTUAL_CONFIG_PATH environment variable to /config/config.json. The content of the json file is: ```json {"openId":{"authMethod":"oauth2","client_id":"actualbudget","client_secret":"","issuer":"https://login.example.com/context/path","server_hostname":"https://actual.example.com"}} ``` I get the following error when the pod starts: ``` undefined:1 https://login.example.com/context/path ^ SyntaxError: Unexpected token h in JSON at position 0 at JSON.parse (<anonymous>) at coerce (/app/node_modules/convict/src/main.js:415:29) at /app/node_modules/convict/src/main.js:359:15 at Array.forEach (<anonymous>) at overlay (/app/node_modules/convict/src/main.js:356:21) at /app/node_modules/convict/src/main.js:364:7 at Array.forEach (<anonymous>) at overlay (/app/node_modules/convict/src/main.js:356:21) at /app/node_modules/convict/src/main.js:602:11 at Array.forEach (<anonymous>) Node.js v18.20.1 ``` And then the pod exits. ### How can we reproduce the issue? Create a file config.json locally with the content above. ```sh podman run -v .:/config -e ACTUAL_CONFIG_PATH=/config/config.json ghcr.io/actualbudget/actual@sha256:e01806d1bcb53f1b2c0a5252b96a00c0d46a5acf60bddc9d88a166c6aa4cbd96 ``` ### Where are you hosting Actual? Other ### What browsers are you seeing the problem on? Safari, Firefox ### Operating System Linux
GiteaMirror added the bug label 2026-02-28 19:59:13 -06:00
Author
Owner

@lelemm commented on GitHub (Mar 7, 2025):

try this:

{"openId":{"authMethod":"oauth2","client_id":"actualbudget","client_secret":"","discoveryURL":"https://login.example.com/context/path","server_hostname":"https://actual.example.com"}}   

I changed issuer to discoveryURL

@lelemm commented on GitHub (Mar 7, 2025): try this: ```json {"openId":{"authMethod":"oauth2","client_id":"actualbudget","client_secret":"","discoveryURL":"https://login.example.com/context/path","server_hostname":"https://actual.example.com"}} ``` I changed `issuer` to `discoveryURL`
Author
Owner

@chrismilson commented on GitHub (Mar 7, 2025):

I get a different error:

/app/node_modules/convict/src/main.js:679
          throw new Error(output)
                ^

Error: configuration param 'openId.discoveryUrl' not declared in the schema
    at Object.validate (/app/node_modules/convict/src/main.js:679:17)
    at file:///app/src/load-config.js:285:14
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12)

Node.js v18.20.1
@chrismilson commented on GitHub (Mar 7, 2025): I get a different error: ``` /app/node_modules/convict/src/main.js:679 throw new Error(output) ^ Error: configuration param 'openId.discoveryUrl' not declared in the schema at Object.validate (/app/node_modules/convict/src/main.js:679:17) at file:///app/src/load-config.js:285:14 at ModuleJob.run (node:internal/modules/esm/module_job:195:25) at async ModuleLoader.import (node:internal/modules/esm/loader:337:24) at async loadESM (node:internal/process/esm_loader:34:7) at async handleMainPromise (node:internal/modules/run_main:106:12) Node.js v18.20.1 ```
Author
Owner

@lelemm commented on GitHub (Mar 7, 2025):

this is case sensitive. URL in the end

@lelemm commented on GitHub (Mar 7, 2025): this is case sensitive. URL in the end
Author
Owner

@chrismilson commented on GitHub (Mar 7, 2025):

Oh dear, pardon me. Let me try with the correct case

@chrismilson commented on GitHub (Mar 7, 2025): Oh dear, pardon me. Let me try with the correct case
Author
Owner

@chrismilson commented on GitHub (Mar 7, 2025):

Yep looking good after setting "discoveryURL".

@chrismilson commented on GitHub (Mar 7, 2025): Yep looking good after setting "discoveryURL".
Author
Owner

@lelemm commented on GitHub (Mar 7, 2025):

Any other issues let us know. closing the issue

@lelemm commented on GitHub (Mar 7, 2025): Any other issues let us know. closing the issue
Author
Owner

@chrismilson commented on GitHub (Mar 7, 2025):

Thanks @lelemm - will this be a standard schema change coming in a future version?

@chrismilson commented on GitHub (Mar 7, 2025): Thanks @lelemm - will this be a standard schema change coming in a future version?
Author
Owner

@chrismilson commented on GitHub (Mar 7, 2025):

I see context in #4530 Thank you~

@chrismilson commented on GitHub (Mar 7, 2025): I see context in #4530 Thank you~
Author
Owner

@lelemm commented on GitHub (Mar 7, 2025):

yes, we overhauled the config loader to use a schema checker, this made me have to create a new var

@lelemm commented on GitHub (Mar 7, 2025): yes, we overhauled the config loader to use a schema checker, this made me have to create a new var
Author
Owner

@chrismilson commented on GitHub (Mar 7, 2025):

I see the message from coderabbitai:

it now handles backward compatibility by mapping discoveryURL to issuer when present.

Does this mean I shouldn't have seen this error?

@chrismilson commented on GitHub (Mar 7, 2025): I see the message from coderabbitai: > it now handles backward compatibility by mapping discoveryURL to issuer when present. Does this mean I shouldn't have seen this error?
Author
Owner

@lelemm commented on GitHub (Mar 7, 2025):

I see the message from coderabbitai:

it now handles backward compatibility by mapping discoveryURL to issuer when present.

Does this mean I shouldn't have seen this error?

you should since you have values in the config.json. this is for the saved values in the database

@lelemm commented on GitHub (Mar 7, 2025): > I see the message from coderabbitai: > > > it now handles backward compatibility by mapping discoveryURL to issuer when present. > > Does this mean I shouldn't have seen this error? you should since you have values in the config.json. this is for the saved values in the database
Author
Owner

@yieldhog commented on GitHub (Apr 6, 2025):

Documentation needs to be updated https://actualbudget.org/docs/experimental/oauth-auth#config-using-configuration-file

@yieldhog commented on GitHub (Apr 6, 2025): Documentation needs to be updated https://actualbudget.org/docs/experimental/oauth-auth#config-using-configuration-file
Author
Owner

@lelemm commented on GitHub (Apr 7, 2025):

Documentation needs to be updated https://actualbudget.org/docs/experimental/oauth-auth#config-using-configuration-file

True, ty

@lelemm commented on GitHub (Apr 7, 2025): > Documentation needs to be updated https://actualbudget.org/docs/experimental/oauth-auth#config-using-configuration-file True, ty
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#1941