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

WebPanel never comes up during launching jupyter server. Just gets stuck saying "Starting Jupyter Server" #3608

Closed
rchiodo opened this issue Feb 15, 2019 · 26 comments
Assignees

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Feb 15, 2019

After some logging, I think the problem is here:

    const fm = require('file-matcher') as typeof import('file-matcher');
    const matcher = new fm.FileMatcher();

    try {
        const results = await matcher.find(searchOptions); <-- This function never returns.

We could replace this with something else. Something that searches all the files and opens them looking for pattern matches on the contents.

@rchiodo rchiodo self-assigned this Feb 25, 2019
@hidesoon
Copy link

same here,

starting forever

dev tool console:

'''
console.ts:134 [Extension Host] No editors associated with document: c:\Users\xxx\AppData\Roaming\Code\User\settings.json
t.log @ console.ts:134
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\Users\xxx\AppData\Roaming\Code\User\settings.json
2console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\xxxxxxxxxxx\Git\xxxxxxxxxxx
'''

source:
134 console[entry.severity].apply(console, consoleArgs);

%c[Extension Host] %cNo editors associated with document: d:\xxx\Git\xxxxxxxxxxx.vscode\settings.json

%c[Extension Host] %c(node:17552) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

%c[Extension Host] %cNo editors associated with document: c:\Users\xxxxxxxxxx\AppData\Roaming\Code\User\settings.json

@rchiodo
Copy link
Contributor Author

rchiodo commented Feb 28, 2019

You should be able to workaround the bug by the command 'Reload Window'.

Otherwise I just submitted the fix for this. It will be in our next insider's build and release next month.

@rchiodo
Copy link
Contributor Author

rchiodo commented Feb 28, 2019

Insiders build is here:
insiders

@hidesoon
Copy link

hidesoon commented Feb 28, 2019

@rchiodo thank you for promptly respond!

I have tried 'reload window' command and did not work.

May I know how to use/install this insider build please, so I can have a test run before the next release.

@rchiodo
Copy link
Contributor Author

rchiodo commented Feb 28, 2019

You download the vsix and run the "Install Extension from VSIX" command. That should overwrite your Python Extension with the insiders bits. You can check this by looking at the version number in the extensions tab.

It should be the number I show below or higher (in case you get a newer build after I post this comment)

image

@hidesoon
Copy link

hidesoon commented Mar 1, 2019

@rchiodo I have installed the VSIX and tried again.

Still, 'starting Jupyter server' is runing forever

(I can start a Jupyter notebook from cmd only using about 2 sec)

I have screenshot the error information from developer tools

snipaste_2019-03-01_13-12-54

skip some lines

snipaste_2019-03-01_13-14-15

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 1, 2019

Is that the last thing logged? There should definitely be more logging after that. Something like so:

workbench.main.js:sourcemap:287 [Extension Host] Python Extension: Loading web panel. Panel is notset (at Logger.logInformation (d:\vscode-python\src\client\common\logger.ts:45:21))
workbench.main.js:sourcemap:287 [Extension Host] Python Extension: Generating CSS... (at Logger.logInformation (d:\vscode-python\src\client\common\logger.ts:45:21))

Generating CSS ... should be the last thing that was happening before it got stuck before.

Can you also check to see that you don't have the 'Jupyter' extension installed? Don's extension interferes with our bits.

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 1, 2019

And what does your Python extension version say? Just want to double check the vsix actually installed.

@hidesoon
Copy link

hidesoon commented Mar 1, 2019

Q1: Have you installed the dev version?
A1: Yes, you can see the version both in the log file (the 2nd picture I posted last time) and
_20190301163019

Q2: Have you installed other extension which may interfere with this one?
A2: No, please see my current active extenstions
_20190301163706

Q3: Show me the last log info while it got stuck
A3: Here you are
_20190301164513

BTW: It worked well until 3 days ago, I have no idea what happened. I reinstalled both VScode and python, rebuild the virtual env, but still can't fix this problem

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 1, 2019

Can you try downloading the VS Code insiders, installing just the insider's python extension and running from there? The Anaconda Extension may cause problems. Not sure.

You might also try just running the command "Show Python Interactive Window" and see what console log output you get.

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 1, 2019

If you're not getting the 'Loading web panel' output, something might be going wrong just loading the jupyter types (that happens about the same time we start opening the web panel)

@hidesoon
Copy link

hidesoon commented Mar 3, 2019

I have installed VS Code insider and installed this VSIX file. It repeated the same output as the last scenario, that stuck at activating environment .....

This time I only loaded python extension ONLY

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 4, 2019

Okay sounds like we'll need to add more logging to figure out your issue. Give me an hour or two and I'll push new bits with more logging to the insider's build.

rchiodo referenced this issue in microsoft/vscode-python Mar 4, 2019
Add some more logging for issue #4424
rchiodo referenced this issue in microsoft/vscode-python Mar 4, 2019
Add some more logging for issue #4424

For #4424

<!--
  If an item below does not apply to you, then go ahead and check it off as "done" and strikethrough the text, e.g.:
    - [x] ~Has unit tests & system/integration tests~
-->
- [x] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
- [x] Title summarizes what is changing
- [x] Has a [news entry](https://github.com/Microsoft/vscode-python/tree/master/news) file (remember to thank yourself!)
- [x] Has sufficient logging.
- [ ] Has telemetry for enhancements.
- [ ] Unit tests & system/integration tests are added/updated
- [ ] [Test plan](https://github.com/Microsoft/vscode-python/blob/master/.github/test_plan.md) is updated as appropriate
- [ ] [`package-lock.json`](https://github.com/Microsoft/vscode-python/blob/master/package-lock.json) has been regenerated by running `npm install` (if dependencies have changed)
- [ ] The wiki is updated with any design decisions/details.
@hidesoon
Copy link

hidesoon commented Mar 5, 2019

@rchiodo thanks Rich. Let me know whenever ready to start the next experiment :)

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 5, 2019

Hi @hidesoon, the insiders should be ready now. There was some build problems yesterday so I was waiting for the nightly. It has the extra logging in it now.

Can you make sure that you have a cell defined and run it from the 'Run Cell' over top of it? That code path has the most logging right now. Thanks.

@hidesoon
Copy link

hidesoon commented Mar 7, 2019

Hi @rchiodo, sorry for late reply, I was on a business trip.

I updated the python extension to 2019.2.5558 from the insider.

  1. Open VSC; 2. select the code; 3. click Run Cell.

I have tested about 5 times, and each test, it stopped at the same place with the same log.

Only one time of the 5 tests, cmd prompted out an error message, I think that is for Conda.

Enclosed the log and error report for you.

log.txt
ERROR REPORT.txt

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 7, 2019

Okay the logging I added didn't show up. That means it's crashing even earlier than I thought.

Your error report does show something interesting though. Looks like your conda environment is failing to initialize.

My conda version is behind yours, let me try upgrading and see if I can repro.

I would suspect you could get this to work if you used something other than conda if possible.

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 7, 2019

No that works fine for me.

What's your window's locale set to? Something is causing conda to crash. I think we can do a better job of showing an error in this case, but I don't think we can work around it. It would be an anaconda bug.

rchiodo referenced this issue in microsoft/vscode-python Mar 7, 2019
For #4424

<!--
  If an item below does not apply to you, then go ahead and check it off as "done" and strikethrough the text, e.g.:
    - [x] ~Has unit tests & system/integration tests~
-->
- [x] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
- [ ] Title summarizes what is changing
- [x] Has a [news entry](https://github.com/Microsoft/vscode-python/tree/master/news) file (remember to thank yourself!)
- [x] Has sufficient logging.
- [ ] Has telemetry for enhancements.
- [ ] Unit tests & system/integration tests are added/updated
- [ ] [Test plan](https://github.com/Microsoft/vscode-python/blob/master/.github/test_plan.md) is updated as appropriate
- [ ] [`package-lock.json`](https://github.com/Microsoft/vscode-python/blob/master/package-lock.json) has been regenerated by running `npm install` (if dependencies have changed)
- [ ] The wiki is updated with any design decisions/details.
@hidesoon
Copy link

hidesoon commented Mar 7, 2019

It should be an anaconda bug,,,, I re-installed anaconda,,, and it works well now...
and I found if the first line is started with

# %% [markdown]

run cell or run all cell would not do anything (executing cell forever) even this cell has some code...

Suggestion:
This bug seems not made by VS code, however, if VS code can promote some conda issue (error report only appealed once, randomly), then we can locate the issue to anaconda sooner.

Very appreciate your help indeed, @rchiodo

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 8, 2019

Thanks @hidesoon. I'll look for the anaconda bug.

The markdown issue you describe should be fixed in our latest. Or at least I can't repro it.

Just to make sure, you typed this into the code editor?

% ## [markdown]

That gives me this:

% ## [markdown]
UsageError: Line magic function % not found.

@hidesoon
Copy link

hidesoon commented Mar 8, 2019

sorry

# %% [markdown]
# ## Input variables

after updated today, this problem has gone

Thanks @rchiodo

@mwentzWW
Copy link

@rchiodo I believe I have found the main issue from another comment online. When I open a new VS Code window and navigate to a python file with # %% jupyter cells in it the Python environment gets set to some virtualenv I have not created (Example shown below).

image

With this trying to run a cell it gets the interactive window stuck and it gets hung on starting Jupyter like so many comments I have found. Attached is the log below:

log.txt

I believe this has to do with VS Code setting some initial environment causing the issue. Now if I select the anaconda base environment as shown below, then Jupyter starts correctly and works:

image

Attached is the working log file:

working log.txt

I hope this helps solve the issue.

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 28, 2019

@mwentzWW your first virtualenv not working is crashing jupyter (so it must exist)

console.ts:134 [Extension Host] Python Extension: Unable to parse Version of Conda, C:\Users\mwentz\AppData\Local\Programs\Microsoft VS Code>conda.bat activate --version, 
t.log @ console.ts:134
console.ts:134 [Extension Host] Python Extension: Current value for rule workspaceEnvs is nothing
notificationsAlerts.ts:40 Jupyter server crashed. Unable to connect.  Error code from jupyter: 4294967295
onDidNotificationChange @ notificationsAlerts.ts:40
console.ts:134 [Extension Host] Python Extension: Error: Jupyter server crashed. Unable to connect. 
Error code from jupyter: 4294967295
t.log @ console.ts:134

It might be your globally installed python and we're not picking up the environment correctly?

@mwentzWW
Copy link

@rchiodo It might be some issue with an older environment, but I only have one version of Python on my machine through Anaconda. When I select my environments the (virtualenv) isn't listed there, but is still set as the default environment and it won't even run my .py files correctly. Any suggestions on how to fix the default environment? Is this issue only occurring on my machine?

Default broken environment:

image

List of environments that work:

image

@mwentzWW
Copy link

@rchiodo My default Python Path was set to the "current: C:\Anaconda3.7\pythonw.exe" from above, and I changed it to just the normal python.exe and the "(virtualenv)" issue doesn't appear to be happening anymore.

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 29, 2019

@mwentzWW I'm going to create a new issue for you: microsoft/vscode-python#5014. The default environment should be one that works AFAIK.

@rchiodo rchiodo closed this as completed Apr 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 22, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants