Can't login to create-daml-app example on daml-on-fabric

I’m not sure what is going wrong here as I have no errors but I am encountering this issue with running daml-on-fabric locally with 1.8 RC and trying to login as Alice in the UI. The error returned from the JSON API is:

errors: ["JsonError: Cannot resolve template ID, given: Temp…6407140906dcb8b3b7f4b0f8ca0b99c7ac5ce),User,User)"]
status: 400
__proto__: Object

I’ve deployed everything as the https://www.daml.com/learn/deploying-daml/daml-on-fabric/ scenario says and haven’t edited my modules at all since running daml codegen js .daml/dist/my-app-0.1.0.dar -o ui/daml.js

Only thing out of the ordinary is I encounter this error during sbt "run --port 6865 --role provision"

Admin@org1.example.com sign cert: /Users/anthonylusardi/software/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem
Invoke chaincode - going to call: LedgerIDWrite on the chaincode daml_on_fabric
Received 2 tx proposal responses. Successful+verified: 2 . Failed: 0  - Fcn: LedgerIDWrite 
12:15:09.703 INFO  c.d.DamlOnFabricServer$ - Hyperledger Fabric provisioning complete.

Exception: sbt.TrapExitSecurityException thrown from the UncaughtExceptionHandler in thread "run-main-0"
[success] Total time: 45 s, completed Dec 14, 2020, 12:15:09 PM

Also getting this same error in 1.7.0 at the same point:

"JsonError: Cannot resolve template ID, given: TemplateId(Some(b5b1f86483ff42ebfdea3ef260a6407140906dcb8b3b7f4b0f8ca0b99c7ac5ce),User,User)"

Cannot resolve template ID usually means that the package has not been uploaded to the ledger. This could either be because you haven’t uploaded it at all or because you modified the package after uploading which means you have two packages that are completely different to the ledger.

1 Like

That was it! More specifically for daml-on-fabric running the following fixed my issue because I had an old deployment sitting around:

NOTE: In its current implementation docker_clean_all.sh will stop every running container and delete all of your images and containers. This might not be what you want if you’re running containers besides fabric. This was fixed

cd daml-on-fabric/src/test/fixture
./docker_clean_all.sh
./gen.sh
./restart_fabric.sh

The confusing part for me is why weren’t the old templates simply ignored and the templates that I did deploy most recently used since that’s what I compiled the UI against.