Cloud code deployment error

I used Clode Code and deployed using Unity and everything worked flawlessly. But I added a project with unit tests to the Cloude Code solution and an error popped up when I tried to do a deploy: Payload Too Large. Maximum upload size limit of 10MB is exceeded. I don't know how efficient the compression that Unity does before deploy is, but in fact the entire uncompressed Cloud Code soluition was 10.5MB. So I removed the project with the unit tests from the soluition, the size reduced to just over 2MB, but I still get the above error when trying to deploy. I've discarded all changes in GIT, even cloned the repository anew to make sure no local changes affect my soluition, and also tried deploy using the CLI, but the error still occurs. Does anyone know a solution to this problem?

Hi @Pattal97 . Could you attempt this manual workflow for authoring a module?

I have just now managed to get around this problem by creating a new Windows user account on which I started the same project where the error was occurring on my default windows account. Using the new account I can do deploy cloude codu without any problems. Nevertheless, this is just a workaround, not a solution (I won't be making a new account every now and then), but it shows that everything is fine with the project and solution itself, only Unity for some unknown reason throws an error. Any idea what could be related to my default windows account that the error only occurs on it? (Maybe visual studio or Unity has some temporary files or catched data).

Hi @Pattal97 ,

The issue is actually how the IDE caches the additional files, like your unit tests. We have it in our backlog to call "clean" or "rebuild".
In the mean time, there's 2 easy work arounds:
In your IDE, call "Clean" then "Build", or just "Rebuild".

Alternatively, delete the "bin" and "obj" directories under the main project of your cloud code module.

We'll look into making this more automatic as part of the deployment process


Unfortunately, both the first and second methods did not help :/

If you're comfortable, you can PM me your project and we can look into it.
Otherwise, some information regarding your bin folder and its contents could help a lot.


We're looking into it and we've noticed two possible issues:
* Sending the PDBs may cause excess size
* The tests may be inadvertently shipped.

You can change your build configuration/solution to improve the situateion
Alternatively In the mean time, you can delete those, before zipping the CCM, but we'll look into options to improve the workflow.

Adding a little context to what Gab mentioned, if your tests are in a different project within your solution (they need to be in a different project at this time), you'll need to exclude the test project from the solution configuration for the 'Release' configuration

For now, by default when deploying, the CLI and Editor use the 'Release' configuration

The tests are causing your solution to be too large for the Cloud Code service (as tests have a lot of heavy dependencies)

You can read more on solution configurations here:

So I removed the project with the unit tests from the soluition, the size reduced to just over 2MB, but I still get the above error when trying to deploy.

Concerning this, there is currently a bug where the temporary folder that your solution gets compiled to doesn't clear itself every time it gets compiled (this is a one-time fix unless you generate the tests again).

To fix that, you'll have to go to your temp folder
- In MacOS, open terminal, type echo $TMPDIR to get the temp folder path
- In Windows, the temp folder should be at C:\Users\AppData\Local\Temp
- In any OS, you can find out what your temp path is using Debug.Log($"{Path.GetTempPath()}/{your_solution_name}"); inside of Unity

Then append the name of your main project within your solution

Go in the folder and delete the module-compilation folder

Sorry for the inconvenience, we're working on a fix

1 Like

Thank you guys! Everything works as it should :)

1 Like