SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.02k forks source link

Connect-SPOService: Object reference not set to an instance of an object. #9434

Open SimonSimCity opened 10 months ago

SimonSimCity commented 10 months ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

other (enter in the "Additional environment details" area below)

Developer environment

macOS

What browser(s) / client(s) have you tested

Additional environment details

PowerShell module Microsoft.Online.SharePoint.PowerShell v16.0.24322.12000

Describe the bug / error

I'm currently trying to get started with Sharepoint Embedded (https://learn.microsoft.com/en-us/sharepoint/dev/embedded/mslearn/m02-03-hol). To be able to follow this guide, I joined the Microsoft developer program (https://developer.microsoft.com/en-us/microsoft-365/dev-program) and tried to connect to the environment created by the assistant there.

I could find the there described option to enable Sharepoint Embedded, but when I tried to create the container type, I should run the command Connect-SPOService which errored by giving me an error message I could not find out what to do next:

Connect-SPOService: Object reference not set to an instance of an object.

As of what I've found online, there seems to be some error in the script provided by this package. I'd love to be able to have a look at the code which you run here, but this doesn't seem to be open source ...

Steps to reproduce

  1. Install-Module -Name Microsoft.Online.SharePoint.PowerShell
  2. Import-Module "Microsoft.Online.SharePoint.PowerShell"
  3. Connect-SPOService -Url "https://******-admin.sharepoint.com"

Expected behavior

Based on the documentation, I should be prompted for my credentials, but I wasn't. I tried to add some parameters, as described in the documentation of the script (https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/connect-sposervice?view=sharepoint-ps). Adding the parameter -credential, as shown in the first example, I was first prompted for my password, but the application then stopped with the same error, after I entered the password.

ghost commented 10 months ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

brianavvoka commented 10 months ago

Any update on this issue? Am facing the exact same problem

SimonSimCity commented 10 months ago

@brianavvoka I got it working by running the commands in PowerShell on Windows. But this is just a work-around. A proper fix would be to have it also working on Mac (don't know about Linux).

jleon1984 commented 10 months ago

@brianavvoka I got it working by running the commands in PowerShell on Windows. But this is just a work-around. A proper fix would be to have it also working on Mac (don't know about Linux).

Same in Linux

cblomart commented 10 months ago

Same here...

rpn-wv commented 10 months ago

Have the same problem...

FrUct1s commented 9 months ago

Same issue on macOS Powershell

nvaert1986 commented 9 months ago

I can confirm the same problem exists using Microsoft PowerShell on Linux.

Machinethreat commented 9 months ago

Also confirming PowerShell on Linux. I know "Object Reference not set to an Instance of an Object" is an ol' .Net error. Tried installing aspnetcore 8.0. No dice.

moisesrodriguez commented 9 months ago

I can confirm this is still an issue on macOS PowerShell 7.4.1

jmergy commented 8 months ago

confirming on debian 12.5 powershell

Connect-SPOService: Object reference not set to an instance of an object.

Koneisto commented 8 months ago

confirming on MacOS 14.4 and PowerShell 7.4.1 as of today

Connect-SPOService: Object reference not set to an instance of an object.

SakkeWeb commented 8 months ago

MacOS 14.4.1 and PowerShell 7.4.1 Issue still exists. Runs in Win11 Arm64 running in VmWare Fusion on the same device.

pascalinger commented 8 months ago

Confirming for MacOS 14.4 (23E214) on MacBook Air M1 (2020) PowerShell Version: 7.4.1

breisig commented 7 months ago

Having the SAME issue with Rocky Linux 9.4 x64 with Powershell Version: 7.4.1

USRobotics1 commented 7 months ago

Same problem here Macbook M1 Pro Sonoma 14.4.1, powershell version 7.4.1

sudharsank commented 7 months ago

Hi All,

I too had the same problem when i tried with PS Version 7. I think its with the PS version. When i tried the same with version 5.xxx, it worked. Please refer the screenshot below

image

jeroenst commented 7 months ago

I'm having the same issue.

Connect-SPOService: Object reference not set to an instance of an object.
PS /root/.local/share/powershell/Modules/Microsoft.Online.SharePoint.PowerShell> $psversiontable

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Linux Mint 21.2
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
HenningBree commented 7 months ago

I am having the same issue. Name Value


PSVersion 7.4.1 PSEdition Core GitCommitId 7.4.1 OS Darwin 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:28:58 PST 2023; root:xnu-10002.81.5~7/RELE… Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

sirishaalurikpmg commented 7 months ago

Can anyone help us please , we are also facing same issue

toffitomek commented 6 months ago

Same issue, Apple Silicon, PS 7.4.2

rpn-wv commented 6 months ago

[like] Roman Poroshyn reacted to your message:


From: toffitomek @.> Sent: Wednesday, May 15, 2024 12:44:56 PM To: SharePoint/sp-dev-docs @.> Cc: Roman Poroshyn @.>; Comment @.> Subject: Re: [SharePoint/sp-dev-docs] Connect-SPOService: Object reference not set to an instance of an object. (Issue #9434)

ACHTUNG: Diese E-Mail stammt von außerhalb des Wupperverbandes. Bitte öffnen Sie keine Links oder Dateianhänge, wenn Sie die AbsenderInnen nicht kennen oder nicht wissen, dass der Inhalt sicher ist.

Same issue, Apple Silicon, PS 7.4.2

— Reply to this email directly, view it on GitHubhttps://github.com/SharePoint/sp-dev-docs/issues/9434#issuecomment-2112424404, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BBRTBNWDLXKOUJGGZZT5CGLZCNKERAVCNFSM6AAAAABBNH7HVKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSGQZDINBQGQ. You are receiving this because you commented.Message ID: @.***>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Wupperverband - Körperschaft des öffentlichen Rechts Untere Lichtenplatzer Straße 100 - D-42289 Wuppertal Tel.: +49 202 583 0 - Fax: +49 202 583 101 - @.*** - www.wupperverband.de

Facebook | Wupperverbandhttps://www.facebook.com/wupperverband/ Instagram | Wupperverbandhttps://www.instagram.com/wupperverband/

Vorsitzende des Verbandsrates: Dipl.-Ök. Claudia Fischer - Vorstand: Dipl.-Ing. Ingo Noppen

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Der Wupperverband ist verantwortlich für die Wasserwirtschaft im gesamten Flussgebiet der Wupper. 14 Talsperren, 11 Kläranlagen und 2.000 km Gewässer bilden für ca. 950.000 Menschen im Verbandsgebiet einen wesentlichen Teil ihrer Lebensgrundlage.

Der Schutz und die nachhaltige Bewirtschaftung der Gewässer stehen im Mittelpunkt sowie leistungsgerechte Kosten und maximale Leistung für Mitglieder und Bürger*innen.

Wir sind als familienfreundliches Unternehmen zertifiziert. Wir denken Vereinbarkeit weiter.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

wmayner commented 6 months ago

Same issue, Apple silicon, PS 7.4.2

Sushanta-Saha commented 6 months ago
Screenshot 2024-05-21 at 12 24 27 PM

How to fix this issue in Mac OS 14.4 M2 processor. Urgent

0ut1ier commented 6 months ago

Same issue, Mac 14.4., PS 7.4.2, Module 16.0.2481

kawilkins commented 6 months ago

I am having the same issue. I can use the ExchangeOnlineManagement and Microsoft.Graph modules with no issue.

Error: Connect-SPOService: Object reference not set to an instance of an object.

OS and Powershell info:

PS /home/kwilkins> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Ubuntu 22.04.4 LTS
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
ftoledo commented 6 months ago

same here on powershell on Debian gnu/linux

Spaider commented 6 months ago

Maybe this will help somehow:

PS /Users/admin/Temp/SharePointFun> Connect-SPOService -Url https://contoso-admin.sharepoint.com
Connect-SPOService: Object reference not set to an instance of an object.
PS /Users/admin/Temp/SharePointFun> $Error[0].Exception | Format-List * -Force

TargetSite     : Microsoft.Online.SharePoint.PowerShell.SPOService InstantiateSPOService(System.Uri, System.Management.Automation.PSCredential, System.Management.Automation.Host.PSHost, System.String, System.String, Boolean, Boolean)
Message        : Object reference not set to an instance of an object.
Data           : {}
InnerException :
HelpLink       :
Source         : Microsoft.Online.SharePoint.PowerShell
HResult        : -2147467261
StackTrace     :    at Microsoft.Online.SharePoint.PowerShell.SPOServiceHelper.InstantiateSPOService(Uri url, PSCredential credentials, PSHost host, String authenticationUrl, String clientTag, Boolean forceOAuth, Boolean enableModernAuthFlow)
                    at Microsoft.Online.SharePoint.PowerShell.SPOServiceHelper.InstantiateSPOService(Uri url, PSCredential credentials, PSHost host, AADCrossTenantAuthenticationLocation region, String clientTag, Boolean enableModernAuthFlow)
                    at Microsoft.Online.SharePoint.PowerShell.ConnectSPOService.ProcessRecord()
                    at System.Management.Automation.CommandProcessor.ProcessRecord()
florianrohde commented 5 months ago

I am affected on MacOS Ventura and Online Powershell:

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             CBL-Mariner/Linux
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
tmechen commented 5 months ago

still a problem, also affected via macos with powershell

PS /Users/tmechen> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 PDT 2024; root:xnu-1006…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS /Users/tmechen> Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version

Name                                   Version
----                                   -------
Microsoft.Online.SharePoint.PowerShell 16.0.24908.12000
aricooperdavis commented 5 months ago

Still a problem on Linux

PS /home/ari> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Fedora Linux 40 (Workstation Edition)
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Lithilion commented 5 months ago

This is still an issue. Is there a timeline to get this fixed? With this bug the entire module is not usable.

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.3
PSEdition                      Core
GitCommitId                    7.4.3
OS                             Debian GNU/Linux 12 (bookworm)
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS> Get-Module -ListAvailable -Name Microsoft.Online.SharePoint.PowerShell  | Select Name,Version
Name                                            Version
----                                            -------
Microsoft.Online.SharePoint.PowerShell          16.0.24908.12000
syntetikvision commented 4 months ago

More than 6 months and this issue still here ? Can't believe this is possible in a company like Microsoft. What you need more to fix this ??

santesson commented 4 months ago

Please fix this issue.

khill-fbmc commented 4 months ago

Jumping on the train... image

Dear Microsoft, Please fix. Thank you, -Kevin

AlbertoMijares commented 4 months ago

Experiencing the same problem

durzel commented 4 months ago

Same issue - PWSH version 7.4.3 on macOS Sonoma.

Sermo-jasonberndt commented 4 months ago

I am having this issue as well. Please fix.

gnordli commented 4 months ago

Also experiencing the issue on Ubuntu 22.04

mscola75 commented 3 months ago

and on Mint OS

derek-chung-fx commented 3 months ago

Still an issue in August 2024...

pascalinger commented 3 months ago

Still an issue...

Tloncaric92 commented 3 months ago

still an issues, i am on 7.4.4 on macOS but i havent had the same issue on my windows vm running 2022 server nor my windows 10 machine same version of Sharepoint Powershell howver exchange, graph all work, even the teams module, but not sharepoint

ssteele-Arcadia commented 3 months ago

Confirming issue still here with macOS - get this ticket assigned out

Sean-FFC commented 3 months ago

Still an issue 2024-08-16

jlaundry commented 3 months ago

I also found this issue trying to use Azure Cloud Shell. Any response would be appreciated (please)!

jvaldman commented 2 months ago

same here

Name Value


PSVersion 7.4.5 PSEdition Core GitCommitId 7.4.5 OS Darwin 23.6.0 Darwin Kernel Version 23.6.0: Thu Jun 20 00:26:14 PDT 2024; root:xnu-… Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

heytega commented 2 months ago

This is still a problem on the MacOS Ventura 13.6.9 (22G830)

PS version 7.4.5

SadRebel1000 commented 2 months ago

still an issue on Azure Cloud Shell, 2 sept. 2024

jmergy commented 2 months ago

Hey folks - it's not going to be fixed. Perhaps we can log this as an issue for Co-Pilot and AI? Maybe that can get some attention?