Skip to content

Version 1.19.0, the problem classifier cannot add a category by clicking #46744

Open

Description

@dengyazhou

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.19.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image

✔️ Expected Behavior

Hope to click "Add"

❌ Actual Behavior

No response

Activity

  1. dosubot commented on Nov 19, 2026

    @dosubot

    Hi @dengyazhou! I'm Dosu and I'm helping the Dify team.

    This may match #45643, which reports the same Add Category failure on 1.19.0 with TypeError: crypto.randomUUID is not a function. It occurs when the category handler uses a browser API unavailable on a non-secure LAN HTTP address. [1]

    On the affected page, open DevTools → Console and run these read-only checks:

    window.isSecureContext
    typeof globalThis.crypto?.randomUUID

    If they return false and "undefined", and clicking Add logs that error, the workaround is to access Dify through HTTPS with a browser-trusted certificate, rather than http://<server-IP>. Maintainers have consolidated this classifier failure in #45147. [2]

    If you're already using trusted HTTPS, please share your browser/version and the Console error produced when clicking Add, so we can distinguish your case from that failure.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dify

  2. grinem commented on Nov 19, 2026

    @grinem

    Can you open your browser console (F12) when clicking "Add" and share the error log here?

  3. Luckyou-d commented on Nov 19, 2026

    @Luckyou-d
    Contributor

    Diagnosis: the Add button in the question classifier's class list calls crypto.randomUUID() to build the new class ID. That API exists only in secure contexts (HTTPS or localhost); a self-hosted 1.19.0 deployment served over plain HTTP has no crypto.randomUUID, so clicking Add throws TypeError: crypto.randomUUID is not a function and no category can be added - matching your screenshot.

    Good news: this was fixed on main today by #46720 (the class list now uses the uuid package's v4, which works in every context). The fix is scheduled for the 1.20.0 release; 1.19.0 shipped before it landed. Nothing further to fix here, so I'll leave it - closing as already addressed on main (the maintainers can confirm).

  4. dengyazhou commented on Nov 19, 2026

    @dengyazhou
    Author

    image. It has been temporarily resolved.Access with localhost.ssh -N -L 8000:127.0.0.1:80 dengyazhou@192.168.132.128

  5. dengyazhou commented on Nov 19, 2026

    @dengyazhou
    Author
  6. dosubot commented on Nov 19, 2026

    @dosubot

    That console error confirms the crypto.randomUUID() failure discussed above. Your SSH tunnel works because opening Dify at http://localhost:8000 gives the browser a trustworthy local context, unlike a plain HTTP LAN-IP address. This matches the cause documented in #46720.

    As of November 19, the fix has merged into main: Question Classifier category IDs now use the uuid package instead of calling crypto.randomUUID() directly. The PR does not confirm a release version, so I would not promise 1.20.0 yet. You can keep using your localhost tunnel, or browser-trusted HTTPS, as the workaround. Fix details

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about dify with Dosu

  7. dengyazhou commented on Nov 19, 2026

    @dengyazhou
    Author

    I see.

  8. fxia0018 commented on Nov 20, 2026

    @fxia0018
    Contributor

    Thanks for the report! Confirmed the root cause: the "Add" button in the question classifier calls crypto.randomUUID(), which only exists in secure contexts (HTTPS or localhost). On a self-hosted deployment served over plain HTTP it is undefined, so clicking Add throws and no class can be created.

    I've opened #46815 to guard the call and fall back to a timestamp-based id, matching the pattern already used in use-document-actions.ts. The same unguarded call in the agent output-routes toggle is fixed too.

  9. grinem commented on Nov 20, 2026

    @grinem

    Spot on. crypto.randomUUID() will throw on plain HTTP / raw IP since the browser won't treat it as a secure context.

    Just heads up on PR #46815: sticking strictly to a timestamp fallback can lead to duplicate keys if someone double-clicks fast or loops through a batch add. Something like Date.now() + '-' + Math.random().toString(36).substring(2, 9) or a quick uuid polyfill avoids those collision issues completely.

    Also worth checking the agent output-routes toggle while you're in there, it runs into the exact same problem.

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

    1.19.0Bugs from 1.19.0🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions