运行快速入门教程时,如果尝试将数据持久保存到Postgres数据库中,则在重新启动沙箱时,控制台中会出现分类帐标识符不匹配的情况。
在检查数据库之后,合同的信息仍然存在,但是ledger_entries
为空。
步骤:
daml new quickstart quickstart-java
cd quickstart
daml build
daml sandbox dist/quickstart.dar --sql-backend-jdbcurl jdbc:postgresql://localhost/postgres?user=user&password=pass
以下是控制台上的输出:
HikariPool-1 - Start completed.
HikariPool-2 - Starting...
HikariPool-2 - Start completed.
running Flyway migration..
Flyway Community Edition 5.2.4 by Boxfuse
Database: jdbc:postgresql://localhost/postgres (PostgreSQL 11.3)
Flyway upgrade recommended: PostgreSQL 11.3 is newer than this version of Flyway and support has not been tested.
Successfully validated 4 migrations (execution time 00:00.053s)
Current version of schema "public": 3
Schema "public" is up to date. No migration necessary.
Flyway schema migration finished successfully applying 0 steps.
Ledger id mismatch. Ledger id given ('sandbox-69cc5004-a456-4372-9979-74e3e0eb94d2') is not equal to the existing one ('sandbox-3896b4a5-3b50-4d75-b062-7370898eac2d')!
Could not start PostgreSQL persistence layer
java.lang.RuntimeException: Ledger id mismatch. Ledger id given ('sandbox-69cc5004-a456-4372-9979-74e3e0eb94d2') is not equal to the existing one ('sandbox-3896b4a5-3b50-4d75-b062-7370898eac2d')!
这是不受控制的错误吗?还是保存在数据库中的数据不一致?
答案 0 :(得分:1)
您可以将固定的分类帐ID作为命令行选项--ledgerid my-ledger
传递到沙箱。
不过我明白你的意思。如果沙盒从数据库中获取分类帐ID,那将是更好的体验。