langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
45.3k stars 6.36k forks source link

cannot save the code in code block #7469

Closed MartinBTM closed 2 weeks ago

MartinBTM commented 3 weeks ago

Self Checks

Dify version

0.6.14

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

when I fill in some code in code block, it can not save when I switch to other page, I try to publish, also not work see the pic below 20240821104303 20240821104229

✔️ Expected Behavior

save my code

❌ Actual Behavior

Return to the initial status

dosubot[bot] commented 3 weeks ago

@MartinBTM Hello there! I'm a bot here to help you with bugs, questions, or becoming a contributor. Let me know how I can assist you while you wait for a human maintainer.

To save the code in a code block in Dify version 0.6.14 when using the self-hosted Docker setup, you can follow these steps:

  1. Clone the Dify source code to your local machine:

    git clone https://github.com/langgenius/dify.git
  2. Navigate to the docker directory in the Dify source code and execute the following commands to start the middleware services (PostgresSQL, Redis, Weaviate):

    cd dify/docker
    cp middleware.env.example middleware.env
    docker compose -f docker-compose.middleware.yaml up -d
  3. Navigate to the api directory, copy the environment variable configuration file, generate a random secret key, and install dependencies:

    cd ../api
    cp .env.example .env
    openssl rand -base64 42 | sed -i 's/SECRET_KEY=.*/SECRET_KEY=<your_value>/' .env
    poetry env use 3.10
    poetry install
  4. Perform database migration:

    poetry shell
    flask db upgrade
  5. Start the API service:

    flask run --host 0.0.0.0 --port=5001 --debug
  6. Start the Worker service for asynchronous tasks:

    celery -A app.celery worker -P gevent -c 1 -Q dataset,generation,mail,ops_trace --loglevel INFO
  7. Navigate to the web directory, install dependencies, configure environment variables, build the code, and start the web service:

    cd ../web
    npm install
    cp .env.example .env.local
    npm run build
    npm run start
  8. Access Dify by visiting http://127.0.0.1:3000 in your web browser.

These steps should help you save and manage your code in a code block while using the self-hosted Docker setup for Dify version 0.6.14 [1][2].

To continue talking to Dosu, mention @dosu.

crazywoola commented 2 weeks ago

Please upgrade to v0.7.1 to see if this is resolved.