continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.31k stars 1.67k forks source link

Continue Server is not getting started. #387

Closed vigneshrams closed 1 year ago

vigneshrams commented 1 year ago

Describe the bug I have installed the continue extension. But when I open the extension window I see the loading continue server forever

To Reproduce Steps to reproduce the behavior:

  1. Just installed Continue extension and was not able to start Continue server.
  2. VS code version details below,
    Version: 1.81.1
    Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
    Date: 2023-08-09T22:20:33.924Z
    Electron: 22.3.18
    ElectronBuildId: 22689846
    Chromium: 108.0.5359.215
    Node.js: 16.17.1
    V8: 10.8.168.25-electron.0
    OS: Darwin x64 19.6.0

Expected behavior Should start continue server and work normally.

Screenshots

image

Environment

Console logs

image

Additional context I am trying to use Continue for the first time.

sestinj commented 1 year ago

@vigneshrams I tried a fresh re-install on my own computer (also a Mac) by deleting the .continue folder and found that there were a couple of errors, so I fixed those, and a new version is out with those changes, but it doesn't look (from the logs you've sent) like that is the problem.

It's possible that we built a binary that doesn't work on Mac Intel chips, which I will take a deeper look at tomorrow. If you try to run the binary at ~/.vscode/extensions/continue.continue-0.0.316/server/exe/run, this would directly show whether the server is able to start, and would be helpful for further debugging.

vigneshrams commented 1 year ago

@sestinj From running the cmd to start the server manually, Below is the error I got. Hope it has to do with MacOS Version.

[16002] Error loading Python lib '/var/folders/5m/fcsn_rpx17zf0gm7fzzmk_k80000gn/T/_MEIxGPKJ2/libpython3.10.dylib': dlopen: dlopen(/var/folders/5m/fcsn_rpx17zf0gm7fzzmk_k80000gn/T/_MEIxGPKJ2/libpython3.10.dylib, 10): Symbol not found: _preadv
  Referenced from: /var/folders/5m/fcsn_rpx17zf0gm7fzzmk_k80000gn/T/_MEIxGPKJ2/libpython3.10.dylib (which was built for Mac OS X 11.7)
  Expected in: /usr/lib/libSystem.B.dylib
 in /var/folders/5m/fcsn_rpx17zf0gm7fzzmk_k80000gn/T/_MEIxGPKJ2/libpython3.10.dylib
sestinj commented 1 year ago

Thanks for sharing. MacOS architecture likely the issue. We're working on getting around GitHub's lack of Apple Silicon support, will update once solved

vigneshrams commented 1 year ago

Thanks for the update. If you want anything from my end please let me know. I'm really excited to try continue.

On Tue, Aug 22, 2023, 11:00 PM Nate Sesti @.***> wrote:

Thanks for sharing. MacOS architecture likely the issue. We're working on getting around GitHub's lack of Apple Silicon support, will update once solved

— Reply to this email directly, view it on GitHub https://github.com/continuedev/continue/issues/387#issuecomment-1688627252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEBEHFAUMJD5NZ2KQDKFPDXWTUE3ANCNFSM6AAAAAA3WKXPNU . You are receiving this because you were mentioned.Message ID: @.***>

matiasdominguez commented 1 year ago

Also happening to me. I was using Continue just fine as of last week, a coworker mentioned being unable to use the extension today, just checked and I'm also unable to load the server anymore.

sestinj commented 1 year ago

@vigneshrams @matiasdominguez I've just shipped a version (v0.0.323) that will use a mac m1 binary, and I expect this was the cause of these problems. Please let me know if this solves it—if not, I'll dig back in.

matiasdominguez commented 1 year ago

@vigneshrams @matiasdominguez I've just shipped a version (v0.0.323) that will use a mac m1 binary, and I expect this was the cause of these problems. Please let me know if this solves it—if not, I'll dig back in.

thanks! just did a fresh install and it worked.

steps to fix it:

doesn't work just updating, I had to remove the old install by hand

vigneshrams commented 1 year ago

@sestinj v0.0.323 did not fix it for me. I am using an Intel MacBook. Hope that could be the reason.

sestinj commented 1 year ago

@matiasdominguez glad you were able to figure this out so fast and it's working! I did notice that we seem to be not correctly updating the server upon extension update, this is probably what was happening.

@vigneshrams Good to know—means these were probably two separate issues. I'm doing a lot of debugging tonight and will let you know what progress I make. Are you still seeing the same error as before (Error loading python lib?)

gkrawiec commented 1 year ago

fresh first time install of continue extension and I am running into this issue. It is a MacBook 2019 Intel with Ventura 13.5.1 If you need help testing something, let me know.

tomasmcm commented 1 year ago

I also had a similar issue. (I'm on a M1 mac). But instead of continue.log, the console mentioned server_version.txt was missing. After I copied the file from ~/.vscode/extensions/continue.continue-0.0.326/server_version.txt to ~/.continue/server/server_version.txt and restarted VS Code, it loaded properly

sestinj commented 1 year ago

@tomasmcm That is the correct solution, and I've already updated the extension in v0.0.328 to solve the issue, so it should now work out-of-the-box. (https://github.com/continuedev/continue/issues/402)

@gkrawiec @joshpc is everything now working okay for you in v0.0.328?

gkrawiec commented 1 year ago

yes, it is working now. Thank you.

sestinj commented 1 year ago

Super glad to hear it! If more questions arise you're always free to message in our Discord: https://discord.gg/NWtdYexhMs

joshpc commented 1 year ago

@sestinj yep -- deleted everything under ~/.continue and reinstalled, works great out of the box. thanks!

LangLangBart commented 1 year ago

Environment


bisect

Wed Aug 2 06:00 85a4f317 Update package.json version [skip ci]

Tue Aug 1 22:54 0f55a01f correct package.json version

Tue Aug 1 22:47 582d8d06 npx vsce

Tue Aug 1 22:37 f5f9d771 full vsce publish workflow

Tue Aug 1 20:56 0a7cd1d0 purge unecessary functions in envSetup (finally)

Tue Aug 1 20:32 e17388ee fix icon sizes

Tue Aug 1 18:53 10e5b827 fix exe paths

Tue Aug 1 18:39 29096f50 reorder, don't push for now

Tue Aug 1 18:35 a0157175 Merge branch 'package-python' of https://github.com/continuedev/continue into package-python

Tue Aug 1 18:35 e5a97251 uncomment pyinstaller

Wed Aug 2 01:35 bf72167f Update package.json version [skip ci]

Tue Aug 1 18:33 5e2cf036 correctly place permissions at job-level

Tue Aug 1 18:31 29fd79a2 write permissions to push package.json update

Tue Aug 1 18:19 100c15ec purge styled-icons

Tue Aug 1 18:15 6a396783 use hero-icons, instead of styled-icons/heroicons

Tue Aug 1 17:59 9d1be885 --legacy-peer-deps for react-app

Tue Aug 1 17:50 17de821b npm install @styled-icons/styled-icon

Tue Aug 1 17:38 9e94d4f1 remove --legacy-peer-deps flag

Tue Aug 1 17:34 57bcd162 add back typegen script

Tue Aug 1 17:30 4eb1a505 install @nestjs/common

Tue Aug 1 17:22 aa196c22 remove poetry build from package.json

Tue Aug 1 17:19 d3152e3d use nodejs version 19.0.0

Tue Aug 1 17:13 414d102c again update package.json

Tue Aug 1 17:07 2ad87111 remove unnecessary npm packages

Tue Aug 1 17:03 9cabb68b node-16 buster, not 14

Tue Aug 1 17:02 22576f48 install android arm

Tue Aug 1 16:57 2374d1be delete poetry install from main.yaml

Tue Aug 1 16:53 de976046 testing buster

Tue Aug 1 16:43 5fd25cb9 use correct poetry path

Tue Aug 1 16:36 398c4830 run publish on macos, not ubuntu

Tue Aug 1 16:29 2a9d057c fixes to main.yaml, build nodejs

Tue Aug 1 16:06 f9148fd2 tweaking main.yml

Tue Aug 1 16:01 39845167 newer version of setup-python workflow setp

Tue Aug 1 15:54 74472c52 main.yaml package only dist/run

Tue Aug 1 15:49 2d5d4985 main.yaml only setup python once

Tue Aug 1 15:40 9513bcd1 use python 3.11 for pyinstaller


---
### workaround 
#### idea 1 
- just use **[v0.0.236]** 😅

#### idea 2 
- build the `run` binary yourself locally on macOS 10.15 and run it every time you launch `VSCode`

> [!IMPORTANT]
> _On macOS, system components from one version of the OS are usually compatible with later versions, but they may not work with earlier versions. While PyInstaller does not collect system components of the OS, the collected 3rd party binaries (e.g., python extension modules) are built against specific version of the OS libraries, and may or may not support older OS versions. [...]_
>
> _For example, to ensure compatibility with “Mojave” (10.14) and later versions, you should set up a full environment (i.e., install python, PyInstaller, your application’s code, and all its dependencies) in a copy of macOS 10.14, using a virtual machine if necessary. Then use PyInstaller to freeze your application in that environment; the generated frozen application should be compatible with that and later versions of macOS._
> Source: [pyinstaller - making-macos-apps-forward-compatible](https://pyinstaller.org/en/stable/usage.html#making-macos-apps-forward-compatible)

```sh
git clone git@github.com:continuedev/continue.git
chmod +x ./build.sh
./build.sh
# ...
# 51745 INFO: Appending PKG archive to EXE
# 51929 INFO: Fixing EXE headers for code signing
# 51967 INFO: Rewriting the executable's macOS SDK version (12.1.0) to match the SDK version of the Python library (10.15.6) in order to avoid inconsistent behavior and potential UI issues in the frozen application.
# 51969 INFO: Re-signing the EXE
# 52372 INFO: Building EXE from EXE-00.toc completed successfully.
./dist/run
# start vscode and it should work 🍀

tl;dr

sestinj commented 1 year ago

@LangLangBart thanks for being so detailed here! It looks like the furthest that GitHub Actions supports is MacOS 11 (https://github.com/actions/runner-images#available-images), which might not be enough given the pyinstaller snippet you shared. It might be possible to setup a self-hosted runner to perform this job though, which I'll look into first.

Another supporting solution might be to include instructions for manually running the server upon failure. Or even just attempting this automatically as a fallback. Theoretically this is as easy as pip install continuedev && python -m continuedev. I'll give this a shot and see if it is a consistent enough fix.

LangLangBart commented 1 year ago
for version in {0..13}; do
        echo -n "Python 3.10.$version: "
        curl -s https://www.python.org/downloads/release/python-310$version/ |
        grep "Release Date:" | sed 's/^[ \t]*//;s/<[^>]*>//g'
done
# Python 3.10.0: Release Date: Oct. 4, 2021
# Python 3.10.1: Release Date: Dec. 6, 2021
# Python 3.10.2: Release Date: Jan. 14, 2022
# Python 3.10.3: Release Date: March 16, 2022
# Python 3.10.4: Release Date: March 24, 2022
# Python 3.10.5: Release Date: June 6, 2022
# Python 3.10.6: Release Date: Aug. 2, 2022
# Python 3.10.7: Release Date: Sept. 6, 2022
# Python 3.10.8: Release Date: Oct. 11, 2022
# Python 3.10.9: Release Date: Dec. 6, 2022
# Python 3.10.10: Release Date: Feb. 8, 2023
# Python 3.10.11: Release Date: April 5, 2023
# Python 3.10.12: Release Date: June 6, 2023
# Python 3.10.13: Release Date: Aug. 24, 2023

diff

--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -17,7 +17,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: "3.10"
+          python-version: "3.10.8"

       - name: Install dependencies
         run: |
@@ -64,7 +64,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: "3.10"
+          python-version: "3.10.8"

       - name: Install Pyinstaller
         run: |
sestinj commented 1 year ago

@LangLangBart Yeah! I'll make this change in the next update, nice find

sestinj commented 1 year ago

Alright, update is released along with new binaries. Lmk if it works?

LangLangBart commented 1 year ago
vigneshrams commented 1 year ago

@LangLangBart @sestinj Its works fine now. I am using the latest version. Thanks a lot for the support.

sestinj commented 1 year ago

Awesome! Huge thanks for the help on this @LangLangBart