Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Daml-ui-template ErrorForum ↗

Daml-ui-template Error

App Development10 posts572 views17 likesLast activity Jun 2020
AR
Arvind_RaoOP
May 2020 2

Hi, I just got the latest template project from GitHub - digital-asset/daml-ui-template and followed the instructions to get the UI running using JS.

However when I try to exercise an option (GIVE), the sandbox shows the following errors.

14:07:13.846 [http-json-ledger-api-akka.actor.default-dispatcher-11] WARN  akka.actor.ActorSystemImpl - Illegal header: Illegal 'origin' header: Illegal origin: Invalid input '/', expected DIGIT or 'EOI' (line 1, column 22): http://localhost:7575/

Please advise.

GE
georg
May 2020 3

That warning is not of concern, I get it too all the time - but not sure why. I think it’s some strange header that the browser sets. The command should still go through though. Can you confirm?

AR
Arvind_Rao
May 2020 2

Yes, looks like its working ok. I stopped it after seeing the warning :wink:

Thanks

GE
georg
May 2020 1

Agree, it’s quite confusing when you first see it. Maybe someone with more intimate knowledge of the JSON API can chime in to understand why that’s being logged.

LE
Leonid_Shlyapnikov
May 2020 1

I have not seen it when used JSON API directly (create/exercise), might be related to how daml-ui constructs the HTTP Header.

@Arvind_Rao do you have a reverse proxy set up in front of the JSON API, anything that could modify the HTTP Header?

Illegal header: Illegal 'origin' header: Illegal origin: Invalid input '/', expected DIGIT or 'EOI' (line 1, column 22): http://localhost:7575/

My understanding, the Akka HTTP library that we use does not like / at the end of the origin header. Looking at the documentation: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin

Origin: null
Origin: <scheme> "://" <hostname> [ ":" <port> ]

so according to the spec, / is not allowed at the end of the origin.

AR
Arvind_Rao
May 2020 1

Nope, no proxy etc setup. Just ran the sample out of box with no changes on Windows 10

CO
cocreature
May 2020 1

Are you using yarn start? That does involve a proxy.

LE
Leonid_Shlyapnikov
May 2020

@Martin_Huschenbett @shaynefletcher I guess we need to remove / at the end of the proxy config.

github.com

digital-asset/daml-ui-template/blob/ec8294113ccecf4005a1405fd625d345034d08e4/ui-js/package.json#L54

  1. ">0.2%",
  2. "not dead",
  3. "not op_mini all"
  4. ],
  5. "development": [
  6. "last 1 chrome version",
  7. "last 1 firefox version",
  8. "last 1 safari version"
  9. ]
  10. },
  11. "proxy": "http://localhost:7575/"
  12. }

@Arvind_Rao if you change package.json so proxy does not have a trailing slash, the warning should go away:

"proxy": "http://localhost:7575"

Please let us know if this fixed the warning and we will update the template.

GA
Gary_Verhaegen
Jun 2020 2

I can reproduce, and I can confirm removing the trailing / in the package.json file resolves the issue (i.e. no more warning).

GA
Gary_Verhaegen
Jun 2020 4

Fix has been merged. Thanks @Arvind_Rao for the bug report!

← Back to Discussions