Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading more than one package to Sandbox fails with Postgres backend #2130

Closed
da-tanabe opened this issue Jul 12, 2019 · 0 comments · Fixed by #2131
Closed

Uploading more than one package to Sandbox fails with Postgres backend #2130

da-tanabe opened this issue Jul 12, 2019 · 0 comments · Fixed by #2131
Assignees
Labels
component/ledger Sandbox and Ledger API

Comments

@da-tanabe
Copy link
Contributor

Attempting to upload more than one package to the Sandbox (provided all packages have been built with the same version of the SDK) fails with this error in the Postgres logs:

2019-07-12 15:44:05.609 UTC [67] ERROR:  duplicate key value violates unique constraint "packages_pkey"
2019-07-12 15:44:05.609 UTC [67] DETAIL:  Key (package_id)=(a5264aaa710fe11a94ac80d71efc1083997ed09f39047888ae1c1d90cc4a549a) already exists.
2019-07-12 15:44:05.609 UTC [67] STATEMENT:  insert into packages(package_id, upload_id, source_description, size, known_since, ledger_offset, package)
	select $1, $2, $3, $4, $5, ledger_end, $6
	from parameters

Sandbox logs nothing.

The faulty code is here: https://github.com/digital-asset/daml/blob/master/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/stores/ledger/sql/dao/PostgresLedgerDao.scala#L1062

It rolls back the entire transaction on the event of any key conflict, which prevents the other DALFs in the same archive from being loaded. Because every DAR contains a copy of the stdlib, this effectively means that only one DAR can be uploaded.

@stefanobaghino-da stefanobaghino-da self-assigned this Jul 26, 2019
@stefanobaghino-da stefanobaghino-da added the component/ledger Sandbox and Ledger API label Jul 26, 2019
@mergify mergify bot closed this as completed in #2131 Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ledger Sandbox and Ledger API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants