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

🐛 Bug Report: Hot-swapping breaks when function is running locally #150

Open
kamarkiewicz opened this issue Nov 23, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@kamarkiewicz
Copy link

👟 Reproduction steps

  1. Create a new Appwrite project with a starter function using python-ml-3.11.
  2. Run it with appwrite run function
  3. Trigger a save action on src/main.py

👍 Expected behavior

Hot-swapping to work. Workaround is to edit node_modules/appwrite-cli/lib/utils.js#L12 with fs.lstatSync which doesn't follow symlinks.

👎 Actual Behavior

ℹ Info: Starting function using Docker ...
♥ Hint: Function automatically restarts when you edit your code.
Preparing for start ...
✓ Success: Visit http://localhost:3000/ to execute your function.
Starting ...
ℹ Info: Hot-swapping function.. Files with change are src/main.py
Error: ENOENT: no such file or directory, stat '/Users/kamar/Projects/appwrite/functions/My Awesome Function/.appwrite/hot-swap/runtime-env/bin/python'
    at Object.statSync (node:fs:1658:25)
    at getAllFiles (/Users/kamar/Library/pnpm/global/5/.pnpm/appwrite-cli@6.1.0/node_modules/appwrite-cli/lib/utils.js:12:16)
    at getAllFiles (/Users/kamar/Library/pnpm/global/5/.pnpm/appwrite-cli@6.1.0/node_modules/appwrite-cli/lib/utils.js:13:27)
    at getAllFiles (/Users/kamar/Library/pnpm/global/5/.pnpm/appwrite-cli@6.1.0/node_modules/appwrite-cli/lib/utils.js:13:27)
    at getAllFiles (/Users/kamar/Library/pnpm/global/5/.pnpm/appwrite-cli@6.1.0/node_modules/appwrite-cli/lib/utils.js:13:27)
    at getAllFiles (/Users/kamar/Library/pnpm/global/5/.pnpm/appwrite-cli@6.1.0/node_modules/appwrite-cli/lib/utils.js:13:27)
    at EventEmitter.<anonymous> (/Users/kamar/Library/pnpm/global/5/.pnpm/appwrite-cli@6.1.0/node_modules/appwrite-cli/lib/commands/run.js:258:37) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/Users/kamar/Projects/appwrite/functions/My Awesome Function/.appwrite/hot-swap/runtime-env/bin/python'
}
^Cℹ Info: Cleaning up ...
✓ Success: Local function successfully stopped.

### 🎲 Appwrite version

Appwrite Cloud

### 💻 Operating system

MacOS

### 🧱 Your Environment

appwrite-cli@6.1.0

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)
@kamarkiewicz kamarkiewicz added the bug Something isn't working label Nov 23, 2024
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

No branches or pull requests

1 participant