Comments (25)
Good news, Everyone! :farnsworth:
I am able to reproduce this error with the NTLM environment that @koltyakov provided. I'm working on the root cause right now and will post an update once I have an estimate for the fix.
Thanks, all, for your patience!
from spgo.
Quick fix for the current version of vscode (set Proxy support for extensions to On, actually Off also works, but I'm not sure about possible negative effects). vscode restart required:
This proxy setting (when set to override
) somehow globally overrides https.Agent
. https.Agent
in turn is used internally when performing NTLM auth. I found an issue in vscode repository where they discuss something related to these changes around https.Agent
.
The big question is how to overcome it without changing vscode settings. I also don't know how it (Proxy for extensions: On) affects other extensions. This setting is new in vscode 1.31. From the other side it can be treated as a bug from vscode, because other extensions, which use https.Agent might also break.
Tomorrow I will try take a closer look at what's possible here.
from spgo.
Hey, thanks, that proxy settings worked for me too,
For those who are in doubt how to do it:
- press ctrl+shift+p
- Open User Settings
- Proxy support
- Set it to off
That worked for me :)
from spgo.
@sg-chrishasz I've just found the root cause, give me a few minutes I will post an update :)
from spgo.
I discovered exactly the same thing. At this point I can't see any easy way to fix it in node-sp-auth
, thus we definitly should ask vscode if it's a bug or not (probably comment at the same thread).
The keypoint here is that we don't use proxy at all, we use only http.agent
, which is get overwritten by vscode. For me it doesn't feel like exactly right behaviour of vscode.
from spgo.
This issue is back with VS Code 1.56.1 and SharePoint 2019 on-prem. Setting the proxy from override to off fixed the issue for me.
from spgo.
Hello @kyleschaeffer ! I'm unable to reproduce the issue you are experiencing with SPGo and Visual Studio Code 1.31.
Diving into this, can you help out with a few environmental details for me?
- Can you confirm which flavor of SharePoint you are connecting to (e.g. on prem, office365, etc.)?
- Also, can you confirm what type of authentication you are using (e.g. digest, NTLM)?
- Is there any other data in the logs that you can share with me?
- are you using the shared or user version of VSCode?
Couple other things which may be helpful:
SPGo is built on top of a few other SharePoint-specific node packages, including SPPull and SPSave. Can you review the following two issues and see if there is any correlation with your current configuration:
from spgo.
Update: I'm still debugging this issue, but have not found a root cause yet. It definitely affects all NTLM environments and is, in my testing, limited to VSCode 1.31 only.
To try to isolate the issue, I created a new extension using the yo
yeoman command, and built a minimal NTLM auth request using sp-request and experienced the exact same error as when working with SPGo.
I have a few theories, that I'm going to keep pursuing:
- There is an incompatibility between the current ntlm .js library and VSCode
- There is an incompatibility between the promise library in use and the new VSCode Promise framework.
I'll provide updates as I have them. Thanks for your patience and debugging help, everyone!
from spgo.
JFYI I also look at this issue because it seems it's somehow closely related to node-sp-auth vs vscode 1.31 vs NTLM auth. I did exactly the same test with minimal vscode extension with sp-request and was able to reproduce the issue.
from spgo.
Someone else has recently created an issue for this in the VSCode repository. microsoft/vscode#68531
I added more context here: microsoft/vscode#68531 (comment)
from spgo.
Works great now with the setting changed. Thanks very much for your assistance!
from spgo.
NTLM v2 btw is now (for half a year I guess) supported, so should not be an issue.
Also, the interesting point is that something related to the update of the VSCode does the thing which when affecting on authentication.
from spgo.
Hi, all. Thanks for the quick feedback. Here is my current config:
{
"sourceDirectory": "dist",
"sharePointSiteUrl": "https://site-url-appears-here.org/",
"publishingScope": "None",
"authenticationType": "NTLM",
"checkInMessage": "Automatically deployed via solution",
"storeCredentials": true,
"remoteFolders": [
"/_catalogs/masterpage/nucleus",
"/_catalogs/wp"
]
}
As you can see, it's NTLM authentication to an on-premises 2016 environment. I don't get much output in the SPGo output log, other than this:
================================ ERROR ================================
401 - undefined
===============================================================================
I get this message when trying to do pretty much anything, including the "Reset Credentials" command.
The spsave
package is actually being used for this same environment with the same NTLM configuration in another package that we wrote (https://github.com/sprtus/pushsp), and it works just fine there. As I mentioned, it also works fine if I downgrade to the November 2018 version of Code.
from spgo.
Interesting - it appears that this issue is related to either NTLM, or a change to VSCode from 1.30.x to 1.31.x. The only thing I can think of here is that VSCode is now using node v10.
Unfortunately at this time I do not have access to an ntlm-secured SharePoint environment. At one point MS had an all-in-one VM for testing/evaluation purposes, but I can't seem to find it. @koltyakov do you know if there is an available VM I could use?
@kyleschaeffer - sorry to pepper you with more questions, but can you help with the following:
- do you have any office365 instances you can try connecting to in order to help confirm if this issue is related to NTLM auth?
- Can you confirm the version of node that you are running locally when you use sppull? (
node -v
) - Can you activate VSCode in developer mode (
help->Toggle Developer Tools
) and see if there are any additional errors available in the console window? - Finally - if you are able to share a login with me via secure channel, I can dive in and help debug this.
Thanks all!
from spgo.
@sg-chrishasz can let you into one of our dev on-prem environments tomorrow (it's 11+ pm here now), also it'll be NTLMv1. Will DM you with creds. But I still not sure that it's not related to some VSCode plugin specific something.
Also, after updating, @kyleschaeffer did you ever tried to drop files containing creds hash and re-enter username and password?
from spgo.
Having same issue, after the vscode update, started to get 401 error, when i insert my credentials
from spgo.
I'm also having the same issue. If I can help by providing logs or config just let me know.
from spgo.
Locally I'm using Node.js v10.13.0. When I get the 401 - undefined
message, this is thrown in the dev tools:
[31m[09:37:19] spsave: StatusCodeError: 401 - undefined�[39m
�[31m at new StatusCodeError (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/request-promise-core/lib/errors.js:32:15)�[39m
�[31m at Request.module.exports.plumbing.callback (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/request-promise-core/lib/plumbing.js:104:33)�[39m
�[31m at Request.RP$callback [as _callback] (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/request-promise-core/lib/plumbing.js:46:31)�[39m
�[31m at Request.init.self.callback (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/request/request.js:185:22)�[39m
�[31m at Request.emit (events.js:182:13)�[39m
�[31m at Request.EventEmitter.emit (domain.js:442:20)�[39m
�[31m at Request.<anonymous> (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/request/request.js:1157:10)�[39m
�[31m at Request.emit (events.js:182:13)�[39m
�[31m at Request.EventEmitter.emit (domain.js:442:20)�[39m
�[31m at IncomingMessage.<anonymous> (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/request/request.js:1079:12)�[39m
�[31m at Object.onceWrapper (events.js:273:13)�[39m
�[31m at IncomingMessage.emit (events.js:187:15)�[39m
�[31m at IncomingMessage.EventEmitter.emit (domain.js:442:20)�[39m
�[31m at endReadableNT (_stream_readable.js:1090:12)�[39m
�[31m at process._tickCallback (internal/process/next_tick.js:63:19)�[39m
�[31mFrom previous event:�[39m
�[31m at coreRequest (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/sp-request/lib/src/core/SPRequest.js:22:16)�[39m
�[31m at spRequestFunc (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/sp-request/lib/src/core/SPRequest.js:69:20)�[39m
�[31m at Function.forEach.spRequestFunc.(anonymous function) [as get] (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/sp-request/lib/src/core/SPRequest.js:109:24)�[39m
�[31m at FileSaver.getFileByUrl (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/spsave/lib/src/core/FileSaver.js:211:31)�[39m
�[31m at /Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/spsave/lib/src/core/FileSaver.js:176:19�[39m
�[31mFrom previous event:�[39m
�[31m at FileSaver.checkoutFile (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/spsave/lib/src/core/FileSaver.js:171:23)�[39m
�[31m at FileSaver.saveFile (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/spsave/lib/src/core/FileSaver.js:51:35)�[39m
�[31m at FileSaver.save (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/spsave/lib/src/core/FileSaver.js:38:18)�[39m
�[31m at saveSingleFile (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/spsave/lib/src/core/SPSave.js:80:76)�[39m
�[31m at exports.spsave (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/spsave/lib/src/core/SPSave.js:41:13)�[39m
�[31mFrom previous event:�[39m
�[31m at Object.spsave (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/node_modules/spsave/lib/src/core/SPSave.js:13:12)�[39m
�[31m at uploadFiles.requestHelper_1.RequestHelper.setNtlmHeader.then.Promise (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/out/src/gateway/spFileGateway.js:130:26)�[39m
�[31m at new Promise (<anonymous>)�[39m
�[31m at uploadFiles.requestHelper_1.RequestHelper.setNtlmHeader.then (/Users/kyle/.vscode/extensions/sitego.spgo-1.3.4/out/src/gateway/spFileGateway.js:129:20)�[39m
Interestingly enough, when I switch to my Office 365 instance and try deploying using SPGo, I get a different error:
================================ ERROR ================================
input.resume is not a function
===============================================================================
Nothing in dev tools when I get this message.
I'm happy to start up a quick Zoom meeting/screen share to help troubleshoot today if needed. This is a client environment so I can't grant access directly, but perhaps we can sort it out.
from spgo.
So I'm not going crazy and it's not just me...
I just upgraded to 1.31 and I can no longer save my files to SharePoint. Awaiting the solution. For now I will try to roll back.
EDIT: I just installed 1.30, which was my previous working version and I am getting a different error now:
================================ ERROR ================================
Invalid argument
===============================================================================
Now I'm back to
================================ ERROR ================================
401 - undefined
===============================================================================
I had to turn off Auto update feature! As it updated for me and when I restarted, I was back the same error. It is working again with version 1.30
from spgo.
Tonight I'm going to look into two things:
- determining the exact version of VSCode where this issue started. That will help me look at any changes which may have affected SPGo. It will also allow me to provide better guidance to everyone on which version of VSCode to use as a workaround.
- Start breaking down node-sp-auth to determine where the incompatibility with VSCode originates. Once I've found the root cause, I'll work with the author to resolve.
@s-KaiNet do you have any recommendations on how best to approach this, or are you able to help troubleshoot?
from spgo.
Thanks @s-KaiNet! I'll keep researching the VSCode proxyAgent issue as well and post up here if I find anything.
from spgo.
Couple notes before I sign off for the night:
- The VSCode CPPTools team actually wrote code to manually disable Proxy Override in their solution https://github.com/Microsoft/vscode-cpptools/pull/2931/files
- VSCode is rewriting all http.agent objects: https://github.com/Microsoft/vscode/blob/43d02af42f42e4d51d6121482c9e49e2461f9693/src/vs/workbench/services/extensions/node/proxyResolver.ts#L256
.... that said, I ran wireshark against a successful and unsuccessful ntlm request, and there were no obvious differences between the two request/response pairs.
I can put code into SPGo to manually disable the proxy override, but that doesn't feel like a well-formed solution. At this point, I think our best bet would be to ask the VSCode team for guidance. @s-KaiNet I'm interested to hear your investigations.
from spgo.
The right behaviour for me is to override http
things only in case if proxy settings were specified in vscode. Currently they override despite if actual proxy was specified or not.
from spgo.
wow that proxy-setting really helped, thank you very much
from spgo.
This issue is back with VS Code 1.56.1 and SharePoint 2019 on-prem. Setting the proxy from override to off fixed the issue for me.
This is also affecting me on our 2013 on-prem. Turning off the proxy setting fixed this for me too. @mellolr1 I'm glad you commented on this as it stopped me from going mad :-)
from spgo.
Related Issues (20)
- V1.7.1 'Publish Local Workspace' now not working. V1.7.0 still works HOT 9
- SPGo On-prem auth issues
- spgo NTLM invalid user credentials HOT 3
- Spgo with Webpack
- Bug: Always publishing minor HOT 3
- Configure Workspace not working on MAC OS BigSUR HOT 3
- Populate/Login throws Cannot read property 'length' of undefined
- Addin only authentication prompts for username and password instead of client ID and Secret
- Same code on multiple site collections (different environments of the same solution)
- Support mono repo
- SPGO not opening Site Assets on SP On-Prem HOT 3
- Unable to authenticate using app password HOT 2
- Extension issue
- Unable to find and download the SPGo (Visual Code extension). File cannot be found. I probably do not have the proper syntax to download the file. The file will be use to install it in Visual Code that lives in a computer that is not connect to the Internet. https://marketplace.visualstudio.com/items?itemName=SiteGo.spgo
- Incorrect Username or Password
- No termina de publicar major version
- SPGo Project Status?? HOT 2
- `Cannot read properties of undefined (reading '0')` HOT 1
- SPGO not connecting the sharepoint online even after following all the steps HOT 1
- No active workspace selected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spgo.