Skip to content

Presets crashes on new install after updating api (0.14.0 beta / main) #2886

Closed

Description

@ewoudwijma

What happened?

Presets crashes on new install after updating api

To Reproduce Bug

  1. Delete presets.json in /edit
  2. Add a new preset use current state
  3. Go to the new preset api text area and add something e.g. "ledmap":1,
  4. Press Save

Then you get this

Screenshot 2022-11-09 at 15 12 15

Checking contents of presets.json in /edit: only {

Expected Behavior

No crash

Install Method

Self-Compiled

What version of WLED?

latest main (0.14.0)

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    confirmed
    on Nov 16, 2022
  2. blazoncek commented on Nov 16, 2022

    @blazoncek
    Contributor

    The bug is due to missing "0":{} in presets.json (since the file was deleted).
    presets.json with "0":{} object is created on boot if the file does not exist. If you delete presets.json while WLED is running and do not reboot, presets.json becomes corrupt (missing 1st element) as no "0":{}object is created.

    There is another bug:
    presets.json may not be created on boot if WLED is compiled without EEPROM support.

  3. ewoudwijma commented on Nov 16, 2022

    @ewoudwijma
    ContributorAuthor

    The file was deleted after the bug occurred, the bug also takes place after an erase and install of WLED.
    Erasing the file was done to continue.

    So reproduce the error by doing a fresh install and update the first created preset.

    The bug is not occurring if you have 2 presets

  4. blazoncek commented on Nov 16, 2022

    @blazoncek
    Contributor

    Please examine presets.json after save of 1st preset. "0":{} is missing which is the root cause.
    I am readying a fix.

  5. MoonModules commented on Nov 16, 2022

    @MoonModules

    Cool, let me know when it is ready ;-)

  6. blazoncek commented on Nov 16, 2022

    @blazoncek
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions