Error during contract deployment: Server returned 413 Payload Too Large

Hey guys!!!
I’m trying to deploy my sway lend contract to testnet v2 and have this error.

I’m made a deployment test

And this test returns this error

Executing task: cargo test --package market --test integration_tests -- testnet_tests::deploy::deploy --exact --nocapture 

   Compiling market v0.1.0 (/Users/alexey/projects/fuel/sway-lend/contracts/market)
    Finished test [unoptimized + debuginfo] target(s) in 5.01s
     Running tests/harness.rs (target/debug/deps/integration_tests-93bb3f8382b70d92)

running 1 test
thread 'testnet_tests::deploy::deploy' panicked at 'called `Result::unwrap()` on an `Err` value: ProviderError("Server returned 413 Payload Too Large: <html>\r\n<head><title>413 Request Entity Too Large</title></head>\r\n<body>\r\n<center><h1>413 Request Entity Too Large</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n")', tests/utils/local_tests_utils/market.rs:205:6
stack backtrace:
   0: rust_begin_unwind
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
   2: core::result::unwrap_failed
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1791:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1113:23
   4: integration_tests::utils::local_tests_utils::market::deploy_market_contract::{{closure}}
             at ./tests/utils/local_tests_utils/market.rs:196:14
   5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/future/mod.rs:91:19
   6: integration_tests::testnet_tests::deploy::deploy::{{closure}}
             at ./tests/testnet_tests/deploy.rs:102:58
   7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/future/mod.rs:91:19
   8: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/future/future.rs:124:9
   9: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/future/future.rs:124:9
  10: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/scheduler/current_thread.rs:541:57
  11: tokio::runtime::coop::with_budget
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/coop.rs:102:5
  12: tokio::runtime::coop::budget
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/coop.rs:68:5
  13: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/scheduler/current_thread.rs:541:25
  14: tokio::runtime::scheduler::current_thread::Context::enter
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/scheduler/current_thread.rs:350:19
  15: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/scheduler/current_thread.rs:540:36
  16: tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/scheduler/current_thread.rs:615:57
  17: tokio::macros::scoped_tls::ScopedKey<T>::set
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/macros/scoped_tls.rs:61:9
  18: tokio::runtime::scheduler::current_thread::CoreGuard::enter
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/scheduler/current_thread.rs:615:27
  19: tokio::runtime::scheduler::current_thread::CoreGuard::block_on
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/scheduler/current_thread.rs:530:19
  20: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/scheduler/current_thread.rs:154:24
  21: tokio::runtime::runtime::Runtime::block_on
             at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/runtime.rs:282:47
  22: integration_tests::testnet_tests::deploy::deploy
             at ./tests/testnet_tests/deploy.rs:125:5
  23: integration_tests::testnet_tests::deploy::deploy::{{closure}}
             at ./tests/testnet_tests/deploy.rs:21:7
  24: core::ops::function::FnOnce::call_once
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
  25: core::ops::function::FnOnce::call_once
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test testnet_tests::deploy::deploy ... FAILED

failures:

failures:
    testnet_tests::deploy::deploy

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 4 filtered out; finished in 4.27s

error: test failed, to rerun pass `-p market --test integration_tests`

 *  The terminal process "cargo 'test', '--package', 'market', '--test', 'integration_tests', '--', 'testnet_tests::deploy::deploy', '--exact', '--nocapture'" terminated with exit code: 101. 
 *  Terminal will be reused by tasks, press any key to close it. 

After that I tried to replot manually, but got the same error

Contract id: 0x72a93926affa29ec272824b28ef98324e7dc9bf2aa364c54e67f5717034b0145
Please provide the address of the wallet you are going to sign this transaction with:fuel19ns9hh56mgkjck94aw0s3035muvnwhtpscnvxf8hth7m6gnv3kyqhm3ght
Transaction id to sign: e6460a5eec7a77ba0dab4edcf77d55e467526efb50b3d9d1aea79147605edc81
Please provide the signature:375ddb4ff22dce4f070ffe9b385e96a053df1b0b438d02adcbf919e8c2f5afa618c3c87a9da5884f8910254ef223725a6b956cf717e1d0f19668200f9146c0ac
Error: Server returned 413 Payload Too Large: <html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>

Please help

src commit:

4 Likes

If I’m stuck with some limits, then tell me where to find them, or maybe there is a flag when depositing, which will increase the limits?

2 Likes

Can you share a little more why you aren’t using the forc deploy command?

1 Like

I have tried both deploys with the script and using the forc deploy command

Output:

> forc deploy --url http://node-beta-2.fuel.network/graphql --gas-price 10  
  Compiled library "core".
  Compiled library "std".
  Compiled library "token_abi".
  Compiled library "oracle_abi".

...

  Bytecode size is 689332 bytes.
Contract id: 0xc37d74c5506ae25aa7b08ef13bdfcef2d06006fd9cd81e8080bde313432efe85
Please provide the address of the wallet you are going to sign this transaction with:fuel19ns9hh56mgkjck94aw0s3035muvnwhtpscnvxf8hth7m6gnv3kyqhm3ght
Transaction id to sign: f525dc0d882fe1665a04e5e6a6ac2d097b703f1376cf63ee365932315ed1873d
Please provide the signature:ace80c55606de8b3ccf1bdbf5473b21c058c1332448777552a93008af2c33cf2fce681d4fe3fcb7f37d9f1e56e6d01d3391c4ed1c207aaf193064e2e2076fe54
Error: Server returned 413 Payload Too Large: <html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>
1 Like

I found that the maximum allowable contract complexity is 500k bytes.

Thanks for sharing this! The limit for the beta-2 network has just been increased to 7mb in fuel-core v0.15.3, so you should be able to deploy now if you update.

That works!!! Thanks a lot!!!
:heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart:

1 Like