# Canton ZipBomb Error

**URL:** <https://forum.canton.network/t/canton-zipbomb-error/3056>\
**Category:** App Development\
**Tags:** daml\
**Created:** [September 1, 2021, 2:03pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056 "2021-09-01T14:03:19Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Almeida](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luis_almeida/32/2440_2.png) [@Luis\_Almeida](https://forum.canton.network/u/Luis_Almeida)\
**Post date:** [September 1, 2021, 2:03pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/1 "2021-09-01T14:03:19Z")

</div>

Hi, I’m trying to upload my Daml project DAR file to Canton and I’m getting the following error:

```haskell
WARN c.d.c.p.a.g.GrpcPackageService:participant=player1 - ZipBomb(CN18404-5): Dar zip file seems to be a zip bomb. err-context:{msg=Invalid DAR: DarUpload, content: [}], location=GrpcPackageService.scala:58}
WARN c.d.c.p.a.g.GrpcPackageService:participant=gameMaster - ZipBomb(CN18404-5): Dar zip file seems to be a zip bomb. err-context:{msg=Invalid DAR: DarUpload, content: [}], location=GrpcPackageService.scala:58}
WARN c.d.c.p.a.g.GrpcPackageService:participant=player2 - ZipBomb(CN18404-5): Dar zip file seems to be a zip bomb. err-context:{msg=Invalid DAR: DarUpload, content: [}], location=GrpcPackageService.scala:58}
ERROR c.d.c.e.CommunityConsoleEnvironment - Command failed on 3 out of 3 instances: (failure on player1): Request failed for player1.
  GrpcRequestRefusedByServer: ABORTED/ZipBomb(CN18404-5): Dar zip file seems to be a zip bomb.; msg=Invalid DAR: DarUpload, content: [}], participant=player1
  Request: UploadDar(Some(examples/tic-tac-toe/TicTacToe-0.0.1.dar),true,true,com.typesafe.scalalogging.LoggerTakingImplicit@4efecae)
  Trailers: Metadata(content-type=application/grpc), (failure on gameMaster): Request failed for gameMaster.
  GrpcRequestRefusedByServer: ABORTED/ZipBomb(CN18404-5): Dar zip file seems to be a zip bomb.; msg=Invalid DAR: DarUpload, content: [}], participant=gameMaster
  Request: UploadDar(Some(examples/tic-tac-toe/TicTacToe-0.0.1.dar),true,true,com.typesafe.scalalogging.LoggerTakingImplicit@4efecae)
  Trailers: Metadata(content-type=application/grpc), (failure on player2): Request failed for player2.
  GrpcRequestRefusedByServer: ABORTED/ZipBomb(CN18404-5): Dar zip file seems to be a zip bomb.; msg=Invalid DAR: DarUpload, content: [}], participant=player2
  Request: UploadDar(Some(examples/tic-tac-toe/TicTacToe-0.0.1.dar),true,true,com.typesafe.scalalogging.LoggerTakingImplicit@4efecae)
  Trailers: Metadata(content-type=application/grpc)

ERROR c.d.c.ConsoleInteractiveRunner - Running bootstrap script failed with an exception ()!

```

I’m using the following command inside of the Canton environment:

```haskell
participants.all.dars.upload("examples/tic-tac-toe/TicTacToe-0.0.1.dar")

```

Should it be of help, I’m following the Getting Started tutorial of Canton with one more participant node and different names.  
Moreover, using projects such as quickstart work flawlessly, but I’m unable to pinpoint what the difference is between the projects.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 1, 2021, 2:20pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/2 "2021-09-01T14:20:43Z")

</div>

Hi @Luis_Almeida and welcome to the forum! Do you get the same issue if you upload the DAR to Sandbox?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 1, 2021, 2:31pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/3 "2021-09-01T14:31:12Z")

</div>

Also are you able to reproduce the issue on Canton if you upload the DAR via `daml ledger upload-dar` rather than via the Canton console?

---

<div class="post-metadata">

**Author:** ![Luis\_Almeida](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luis_almeida/32/2440_2.png) [@Luis\_Almeida](https://forum.canton.network/u/Luis_Almeida)\
**Post date:** [September 1, 2021, 2:35pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/4 "2021-09-01T14:35:48Z")

</div>

Indeed, if I attempt to upload the dar the following error occurs:

```haskell
Created .daml/dist/TicTacToe-0.0.1.dar
Uploading .daml/dist/TicTacToe-0.0.1.dar to localhost:6865
An exception was thrown during the upload-dar command
- GRPCIOTimeout
One reason for this to occur is if the size of DAR file being uploaded exceeds the gRPC maximum message size. The default value for this is 4Mb, but it may be increased when the ledger is (re)started. Please check with your ledger operator.

```

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 1, 2021, 2:37pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/5 "2021-09-01T14:37:11Z")

</div>

Would it be possible to share your tic tac toe project with us so we can see if there’s anything off in the DAR?

---

<div class="post-metadata">

**Author:** ![Luis\_Almeida](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luis_almeida/32/2440_2.png) [@Luis\_Almeida](https://forum.canton.network/u/Luis_Almeida)\
**Post date:** [September 1, 2021, 2:55pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/6 "2021-09-01T14:55:05Z")

</div>

Here you go, thanks!

> **[GitHub - luis-almeida-intellecteu/TicTacToe](https://github.com/luis-almeida-intellecteu/TicTacToe)**
>
> Contribute to luis-almeida-intellecteu/TicTacToe development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 1, 2021, 3:05pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/7 "2021-09-01T15:05:07Z")

</div>

Hi @Luis_Almeida, I am unable to reproduce this with Canton 0.27 and your example. Could you share the exact DAR you get so we can make sure that it’s the same that I get when I build it via `daml build`?

Also are you running `daml ledger upload-dar` against the right port? Canton does not default to port 6865 so you might need to specify the port of the ledger API differently. You can set it via `--host` and `--port` argument to `daml ledger upload-dar`.

---

<div class="post-metadata">

**Author:** ![Luis\_Almeida](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luis_almeida/32/2440_2.png) [@Luis\_Almeida](https://forum.canton.network/u/Luis_Almeida)\
**Post date:** [September 1, 2021, 3:13pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/8 "2021-09-01T15:13:29Z")

</div>

Yes, I believe I have made a mistake. I have tried

```haskell
daml ledger upload-dar --host localhost --port 5011

```

and it uploaded successfully, where port 5011 is the participant node port.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 1, 2021, 3:14pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/9 "2021-09-01T15:14:44Z")

</div>

When trying it via the Canton console, are you sure the file path is correct? Can you try an _absolute_ filepath to the `.daml/dist/TicTacToe-0.0.1.dar` file that is uploaded by `daml ledger upload-dar`s

---

<div class="post-metadata">

**Author:** ![Luis\_Almeida](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luis_almeida/32/2440_2.png) [@Luis\_Almeida](https://forum.canton.network/u/Luis_Almeida)\
**Post date:** [September 1, 2021, 3:18pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/10 "2021-09-01T15:18:16Z")

</div>

Yes, the error when the filepath is not correct is different. it is:

```haskell
ERROR c.d.c.e.CommunityConsoleEnvironment - Command failed on 3 out of 3 instances: (failure on player1): No such file [./examples/tic-tac-toe/TicTacToe-0..1.dar], (failure on gameMaster): No such file [./examples/tic-tac-toe/TicTacToe-0..1.dar], (failure on player2): No such file [./examples/tic-tac-toe/TicTacToe-0..1.dar]

```

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 1, 2021, 3:19pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/11 "2021-09-01T15:19:45Z")

</div>

Does it still fail reproducibly when run from the Canton console with the correct filepath?

---

<div class="post-metadata">

**Author:** ![Luis\_Almeida](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luis_almeida/32/2440_2.png) [@Luis\_Almeida](https://forum.canton.network/u/Luis_Almeida)\
**Post date:** [September 1, 2021, 3:20pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/12 "2021-09-01T15:20:50Z")

</div>

Yes, it does still fail with the same error message as before.

---

<div class="post-metadata">

**Author:** ![Luis\_Almeida](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luis_almeida/32/2440_2.png) [@Luis\_Almeida](https://forum.canton.network/u/Luis_Almeida)\
**Post date:** [September 1, 2021, 3:41pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/13 "2021-09-01T15:41:10Z")

</div>

I have added the Dar file to the repository.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 1, 2021, 3:42pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/14 "2021-09-01T15:42:30Z")

</div>

Did you push? I don’t see anything in there.

---

<div class="post-metadata">

**Author:** ![Luis\_Almeida](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luis_almeida/32/2440_2.png) [@Luis\_Almeida](https://forum.canton.network/u/Luis_Almeida)\
**Post date:** [September 1, 2021, 4:16pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/15 "2021-09-01T16:16:20Z")

</div>

I have now, and I just realised what the error was. It had nothing to do with Daml I’m afraid, I was trying to essentiality upload an empty file to the ledger since I was not copying it correctly to the new location.  
Thanks and sorry for the inconvenience.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 1, 2021, 4:22pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/16 "2021-09-01T16:22:33Z")

</div>

Glad to hear that you got it working!

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 2, 2021, 7:01pm UTC](https://forum.canton.network/t/canton-zipbomb-error/3056/17 "2021-09-02T19:01:53Z")

</div>

The issue where an empty file was reported as a zip bomb has been fixed by @Ratko_Veprek and should make it in the next Canton release.
