Deploy sandbox to dev environment

Hi, I am developing a daml app with sandbox and configured postgres as the persistent (hence there are the sandbox participant and local domain. Recently, I deployed it to a dev server, but realized that isRunningHub keeps returning True on dev server, because domain is not localhost (dabl-react/utils.ts at dac8c02adfde3876cbdab264446ad869f2231aae · digital-asset/dabl-react · GitHub).
The frontend is failing with errors below:

ERROR [damlhub-react:public-token] Error fetching public party token: {}
ERROR [damlhub-react:default-parties] Error determining well known parties {}
POST https://[domain]/.hub/v1/public/token 404

Let me know if more information needed. This is on daml 2.5

Hi Wilson,

As it’s written, dabl-react is written specifically to run on Daml Hub: the code you’re linking to is the check. As of yesterday, we’ve loosened the restrictions up a touch bit it’s still only on Daml Hub.

So I can advise you better - what are you trying to accomplish? What are you getting from dabl-react specifically? As I understand, it’s dabl-react is to interact w/ some Daml Hub-specific APIs (DABL is the old name of Daml Hub). If there’s a legit use case here, we can probably loosen up those checks, though.

For today, a workaround could be just deleting that line.

Hi Daniel,

Thank you for the reply.

The goal right now is just so that the daml app works with sandbox locally and on dev server and it being able to communicate with the Frontend react app.

I see the recent release that added the DomainType.LOCAL_HOST type. Perhaps our dev server was working all along with the DomainType.NON_HUB_DOMAIN and the release broke it by the update here? allow non-hub domains (#47) · digital-asset/dabl-react@dac8c02 · GitHub.

Edit: Checking by deploying a version that use 1.1.2

That seems like a plausible hypothesis. This is my team but not my code; I’ll tag in someone who knows it better… @alex.graham

Confirmed that is the cause. I have set project dependency version for @daml/hub-react to 1.1.2, until we move it onto daml-hub one day. Thank you very much for the help.

Hi @wilsonhsu0102 ,

I need a bit of info to understand what you’re trying to accomplish here and when you’re running into the problem.

By “dev server” do you mean a sandbox not running on Hub, but also not running locally?

Are you getting the error when you’re trying to run:

  1. Everything locally
  2. The UI locally but the sandbox on Hub or another server
  3. Everything on Hub
  4. Everything on a non-hub server

When you get this error: POST https://[domain]/.hub/v1/public/token 404, are you just obfuscating [domain] or does it actually say that? If it’s a domain you own and don’t want to disclose that’s fine - I’m just trying to figure out what what it is out of localhost, {ledgerId}.daml.app or your-domain.com there.

I got the error when everything was running on a non-hub server inside docker-compose. I obfuscated [domain], it was showing the domain of my server.

Hi @wilsonhsu0102,

We’ve updated the hub-react library to 1.1.5 which should fix the issue you’re running into with deploying the app to your own server. If you update the library in your dependencies and give it another try it should work again. Please let me know if the issue persists.

Thanks,
Alex