Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'DifyConfig' object has no attribute 'MAX_SUBMIT_COUNT' #11703

Closed
5 tasks done
dadastory opened this issue Dec 16, 2024 · 6 comments · Fixed by #11706
Closed
5 tasks done

AttributeError: 'DifyConfig' object has no attribute 'MAX_SUBMIT_COUNT' #11703

dadastory opened this issue Dec 16, 2024 · 6 comments · Fixed by #11706
Labels
🐞 bug Something isn't working

Comments

@dadastory
Copy link

dadastory commented Dec 16, 2024

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.14.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I upgrade to v 0.14.0, but docker for api server can not up
when i upgrade new version, it turn out this error

✔️ Expected Behavior

no any error

❌ Actual Behavior

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command
    app = info.load_app()
          ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app
    app = locate_app(import_name, name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app
    __import__(module_name)
  File "/app/api/app.py", line 9, in <module>
    app = create_app()
          ^^^^^^^^^^^^
  File "/app/api/app_factory.py", line 35, in create_app
    initialize_extensions(app)
  File "/app/api/app_factory.py", line 97, in initialize_extensions
    ext.init_app(app)
  File "/app/api/extensions/ext_blueprints.py", line 10, in init_app
    from controllers.console import bp as console_app_bp
  File "/app/api/controllers/console/__init__.py", line 5, in <module>
    from .app.app_import import AppImportApi, AppImportConfirmApi
  File "/app/api/controllers/console/app/app_import.py", line 16, in <module>
    from services.app_dsl_service import AppDslService, ImportStatus
  File "/app/api/services/app_dsl_service.py", line 19, in <module>
    from services.workflow_service import WorkflowService
  File "/app/api/services/workflow_service.py", line 19, in <module>
    from core.workflow.workflow_entry import WorkflowEntry
  File "/app/api/core/workflow/workflow_entry.py", line 18, in <module>
    from core.workflow.graph_engine.graph_engine import GraphEngine
  File "/app/api/core/workflow/graph_engine/graph_engine.py", line 54, in <module>
    class GraphEngineThreadPool(ThreadPoolExecutor):
  File "/app/api/core/workflow/graph_engine/graph_engine.py", line 61, in GraphEngineThreadPool
    max_submit_count=dify_config.MAX_SUBMIT_COUNT,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 856, in __getattr__
    raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'DifyConfig' object has no attribute 'MAX_SUBMIT_COUNT'
@dadastory dadastory changed the title When I upgrade to v 0.14.0 docker for api server can not up When I upgrade to v 0.14.0, but docker for api server can not up Dec 16, 2024
@dadastory dadastory changed the title When I upgrade to v 0.14.0, but docker for api server can not up AttributeError: 'DifyConfig' object has no attribute 'MAX_SUBMIT_COUNT' Dec 16, 2024
@dosubot dosubot bot added the 🐞 bug Something isn't working label Dec 16, 2024
Copy link

dosubot bot commented Dec 16, 2024

The error you're encountering indicates that the DifyConfig object does not have the MAX_SUBMIT_COUNT attribute. This issue might be due to a missing or improperly configured environment variable or a change in the configuration structure in version 0.14.0.

Here are some steps to troubleshoot and resolve this issue:

  1. Check the .env File: Ensure that your .env file includes the MAX_SUBMIT_COUNT variable. It should look something like this:

    MAX_SUBMIT_COUNT=100
    

    This file is crucial for setting environment variables that the application uses.

  2. Verify Configuration Changes: Review any changes in the configuration structure introduced in version 0.14.0. It's possible that the way configuration attributes are defined or accessed has changed.

  3. Update Environment Variables: If the .env file is missing or not properly configured, create or update it with the necessary variables. You can refer to the .env.example file in the repository for guidance on required variables [1].

  4. Rebuild the Docker Image: After updating the .env file, rebuild your Docker image to ensure that the changes are applied:

    docker-compose down
    docker-compose up --build
  5. Check for Code Changes: If the issue persists, check the DifyConfig class in the codebase to ensure that MAX_SUBMIT_COUNT is defined and accessible. It should be part of the configuration settings [2].

By following these steps, you should be able to resolve the issue with the missing MAX_SUBMIT_COUNT attribute.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

yihong0618 added a commit to yihong0618/dify that referenced this issue Dec 16, 2024
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@dadastory
Copy link
Author

@yihong0618 it did not work , bro

@yihong0618
Copy link
Contributor

try again?

@dadastory
Copy link
Author

try again?

@yihong0618 I've set this environment variable, but it doesn't work, is it a mistake to compile the code to the docker hub repository?

@yihong0618
Copy link
Contributor

will take a look tomorrow

@dadastory
Copy link
Author

will take a look tomorrow

@yihong0618 The database has also been changed and can't be rolled back, it's so sad

jiangbo721 pushed a commit to jiangbo721/dify that referenced this issue Dec 20, 2024
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants