[PR #203] fix: fix same file copy #204

Open
opened 2026-02-16 09:19:50 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-sandbox/pull/203
Author: @fatelei
Created: 12/29/2025
Status: 🔄 Open

Base: mainHead: fix_python_restart


📝 Commits (1)

📊 Changes

1 file changed (+11 additions, -0 deletions)

View changed files

📝 internal/core/runner/python/env.sh (+11 -0)

📄 Description

if restart the dify sandbox, python env is keeped, you will meet the panic error

cp: '/usr/lib/python3/dist-packages/linkify_it/__pycache__/ucre.cpytho
n-313.pyc' and '/var/sandbox/sandbox-python//usr/lib/python3/dist-pack
ages/linkify_it/__pycache__/ucre.cpython-313.pyc' are the same file
cp: '/usr/lib/python3/dist-packages/linkify_it/tlds.py' and '/var/sand
box/sandbox-python//usr/lib/python3/dist-packages/linkify_it/tlds.py' 
are the same file
cp: '/usr/lib/python3/dist-packages/linkify_it/main.py' and '/var/sand
box/sandbox-python//usr/lib/python3/dist-packages/linkify_it/main.py' 
are the same file
2025/12/29 16:46:54 server.go:58: [PANIC]failed to initialize python 
dependencies sandbox: exit status 1
panic: 

goroutine 18 [running]:
github.com/langgenius/dify-sandbox/internal/utils/log.(*Log).Panic(...
)
    /home/fatelei/go/src/github.com/fatelei/dify-sandbox/internal/util
s/log/core.go:55
github.com/langgenius/dify-sandbox/internal/utils/log.Panic({0x500aeb?
, 0x0?}, {0x400005cfb0?, 0x0?, 0x0?})
    /home/fatelei/go/src/github.com/fatelei/dify-sandbox/internal/util
s/log/core.go:209 +0x74
github.com/langgenius/dify-sandbox/internal/server.initDependencies()
    /home/fatelei/go/src/github.com/fatelei/dify-sandbox/internal/serv
er/server.go:58 +0xe8
created by github.com/langgenius/dify-sandbox/internal/server.Run in 
goroutine 1
    /home/fatelei/go/src/github.com/fatelei/dify-sandbox/internal/serv
er/server.go:97 +0x28

here we should skip the same file to copy


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-sandbox/pull/203 **Author:** [@fatelei](https://github.com/fatelei) **Created:** 12/29/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix_python_restart` --- ### 📝 Commits (1) - [`026563e`](https://github.com/langgenius/dify-sandbox/commit/026563e9961f3b508fc871673f1e05b66e6519e1) fix: fix same file copy ### 📊 Changes **1 file changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `internal/core/runner/python/env.sh` (+11 -0) </details> ### 📄 Description if restart the dify sandbox, python env is keeped, you will meet the panic error ``` cp: '/usr/lib/python3/dist-packages/linkify_it/__pycache__/ucre.cpytho n-313.pyc' and '/var/sandbox/sandbox-python//usr/lib/python3/dist-pack ages/linkify_it/__pycache__/ucre.cpython-313.pyc' are the same file cp: '/usr/lib/python3/dist-packages/linkify_it/tlds.py' and '/var/sand box/sandbox-python//usr/lib/python3/dist-packages/linkify_it/tlds.py' are the same file cp: '/usr/lib/python3/dist-packages/linkify_it/main.py' and '/var/sand box/sandbox-python//usr/lib/python3/dist-packages/linkify_it/main.py' are the same file 2025/12/29 16:46:54 server.go:58: [PANIC]failed to initialize python dependencies sandbox: exit status 1 panic: goroutine 18 [running]: github.com/langgenius/dify-sandbox/internal/utils/log.(*Log).Panic(... ) /home/fatelei/go/src/github.com/fatelei/dify-sandbox/internal/util s/log/core.go:55 github.com/langgenius/dify-sandbox/internal/utils/log.Panic({0x500aeb? , 0x0?}, {0x400005cfb0?, 0x0?, 0x0?}) /home/fatelei/go/src/github.com/fatelei/dify-sandbox/internal/util s/log/core.go:209 +0x74 github.com/langgenius/dify-sandbox/internal/server.initDependencies() /home/fatelei/go/src/github.com/fatelei/dify-sandbox/internal/serv er/server.go:58 +0xe8 created by github.com/langgenius/dify-sandbox/internal/server.Run in goroutine 1 /home/fatelei/go/src/github.com/fatelei/dify-sandbox/internal/serv er/server.go:97 +0x28 ``` here we should skip the same file to copy --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 09:19:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-sandbox#204