eclipse-leshan / leshan

Java Library for LWM2M
https://www.eclipse.org/leshan/
BSD 3-Clause "New" or "Revised" License
643 stars 407 forks source link

There was a error during Testing FOTA #1557

Closed Bradymu closed 6 months ago

Bradymu commented 7 months ago

Version(s)

leshan 2.0

Which components

leshan_server_demo

Tested With

No response

What happened

We test FOTA and write package 5/0/0

<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
    <head>
        <title>502 Bad Gateway</title>
    </head>
    <body>
        <h1>Bad Gateway</h1>
        <p>The proxy server received an invalid response from an upstream server.<br /></p>
    </body>
</html>

How to reproduce

  1. connect server
  2. excute object 5/0/0 to write firmware package
  3. select file and write (large than 80 MB)
  4. waitting few moments for done, err send out on page https://leshan.eclipseprojects.io/#/clients

Relevant Output

No response

sbernard31 commented 7 months ago

Does it happens when you run leshan-server-demo locally OR only on the sandbox ?

Where to do you get this error ? I don't get you ?

Bradymu commented 7 months ago

we just try it on the sandbox. pls refer the screenshot image

sbernard31 commented 7 months ago

do you succeed to reproduce this issue locally ?

sbernard31 commented 7 months ago

I tested it on Leshan sandbox https://leshan.eclipseprojects.io, using leshan-client-demo locally on my machine with a file of ~5MB. (I didn't have a very good internet connection)

  1. This failed with ENTITY_TOO_LARGE because by default leshan client use COAP.MAX_RESOURCE_BODY_SIZE=8192.
  2. So I increased this value to 8192000 then I test again and it failed because of server request timeout.
  3. So I changed server timeout in leshan-server-demo UI from 5s to 15min, and payload was success fully sent but

    1. server demo UI is not well design to send large data like this. (so there is no UI feedback)
    2. sending large data using block1 is very long (for 5MB this lead to 9831 block1 request (with 512 as block size) and took ~10 minutes to be sent (I don't know if capturing traffic with wireshark make this slower)
    3. using block1 for large data is maybe not a good idea : https://github.com/eclipse-leshan/leshan/wiki/Using-CoAP-Block-Wise-to-transfer-large-file-%3F

    In the end I was not able to reproduce the <title>502 Bad Gateway</title> error.