Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    GCode upload fails: Status Code 413

    Scheduled Pinned Locked Moved Solved
    Duet Web Control
    2
    4
    183
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Tryptamineundefined
      Tryptamine
      last edited by

      I have an issue in my Duet Web interface.
      When trying to upload a gcode, i get:

      Failed to upload FILE.gcode
      bad status code 413
      

      putting the files directly on the SD card works.
      413 appears for The Upload and start, as well as upload gcode in Jobs.

      this apparently is a file size issue:
      Uploading an empty .gcode file (like 1kb) works.
      Uploading a large other file to system files also does not.
      Tested on multiple browsers.

      And confusingly, i could upload the same gcode last week, and did not change the system.

      What could be the issue here?

      Tryptamineundefined 1 Reply Last reply Reply Quote 0
      • Tryptamineundefined
        Tryptamine @Tryptamine
        last edited by

        @Tryptamine

        I just found out:
        If i use the local IP of Duet Web, it succeeds. Using my Domain over Port forwarding to NGINX, the error occurs. So it is a network configuration issue, but not one of Duet Web.

        I will still update this thread with a solution.

        Tryptamineundefined 1 Reply Last reply Reply Quote 0
        • Tryptamineundefined
          Tryptamine @Tryptamine
          last edited by

          @Tryptamine

          I found the solution! The issue was with my NGINX configuration limiting upload file size. Here's what fixed it:

          In my NGINX config for the domain, I added:

          client_max_body_size 100M;
          
          location / {
              # existing settings...
              proxy_read_timeout 300;
              proxy_connect_timeout 300;
              proxy_send_timeout 300;
          }
          

          This increased the max upload size to 100MB and extended the timeout to 5 minutes. After restarting NGINX, the 413 error disappeared and I can now upload larger files through my domain without issues. So happy to have this resolved!

          dc42undefined 1 Reply Last reply Reply Quote 2
          • dc42undefined dc42 marked this topic as a question
          • dc42undefined dc42 has marked this topic as solved
          • dc42undefined
            dc42 administrators @Tryptamine
            last edited by

            @Tryptamine thanks for sharing!

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA