New-MgSiteItem General Exception While Processing

Aperta
#2,906 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp, powershell
Ambito
api

Direzione di ricerca

Inizia dal punto di ingresso New-MgSiteListItem e riproduci il POST a /sites/{site-id}/lists/{list-id}/items usando il payload mostrato, quindi confrontalo con una richiesta che omette Website. Il lavoro è completato quando è possibile creare un elemento dell’elenco contenente un campo hyperlinkOrPicture senza la 500 generalException segnalata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Status: Needs Investigation
Describe the bug

Playing around to test the fix for New-MgSiteList, I created a list as follows:

$params = @{
displayName = "Books"
columns = @(
@{
name = "Author"
text = @{ texttype = "plain | richtext" }
}
@{
name = "PageCount"
number = @{ displayas = "number | percentage" }
}
@{
name = "Website"
hyperlinkOrPicture = @{ isPicture = "false" }
}

)
list = @{
	template = "genericList"
}

}

I can add items to the list with SharePoint Online. But when I attempt to add an item with New-MgSiteListItem, it barfs over the website field (the call works if the Website field is omitted).

$NewItemParameters = @{
fields = @{
Title = 'PowerShell SDK'
Author0 = 'John Smith'
PageCount = '250'
Website = 'https://books.com/joy'
}
}

$NewItem = New-MgSiteListItem -SiteId $site.Id -ListId $List.Id -BodyParameter $NewItemParameters

New-MgSiteListItem_Create: General exception while processing

Status: 500 (InternalServerError)
ErrorCode: generalException
Date: 2024-08-14T12:46:32

Headers:
Cache-Control : no-store, no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 9283d976-9b0d-4392-9db8-41e89f82743e
client-request-id : b4496d6e-9a93-4868-8826-9ed75019e7a9
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"DU2PEPF0002D4A6"}}
Date : Wed, 14 Aug 2024 12:46:32 GMT

Expected behavior

The New-MgSiteListItem cmdlet should work with fields marked as hyperlinkOrPicture

How to reproduce

Run the steps as shown above.

SDK Version

2.22

Latest version known to work for scenario above?

Never known to work

Known Workarounds

No response

Debug output
Click to expand log ``` $NewItem = New-MgSiteListItem -SiteId $site.Id -ListId $List.Id -BodyParameter $NewItemParameters -debug DEBUG: [CmdletBeginProcessing]: - New-MgSiteListItem begin processing with parameterSet 'Create'. DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'. DEBUG: [Authentication]: - Scopes: [Directory.AccessAsUser.All, Directory.ReadWrite.All, email, Files.Read.All, InformationProtectionPolicy.Read, openid, Policy.ReadWrite.Authorization, profile, RecordsManagement.Read.All, Sites.Manage.All, Sites.ReadWrite.All, User.Read, User.Read.All, User.ReadWrite, User.ReadWrite.All, UserAuthenticationMethod.ReadWrite.All].

Confirm
Are you sure you want to perform this action?
Performing the operation "New-MgSiteListItem_Create" on target "Call remote 'POST /sites/{site-id}/lists/{list-id}/items' operation".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://graph.microsoft.com/v1.0/sites/o365maestro.sharepoint.com%2Cfbab3791-95db-4f31-8b07-d777742d60ab%2C14c87b0d-4876-4f7b-a839-23819618981f/lists/ae247a76-ed2f-4ded-8432-84ef2880e62d/items

Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22631; en-IE),PowerShell/7.4.4
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.22.0
client-request-id : 42d90d93-a26f-489d-865d-bae424842752

Body:
{
"fields": {
"Website": "https://books.com/joy",
"Title": "PowerShell SDK",
"Author0": "John Smith",
"PageCount": "250"
}
}

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
InternalServerError

Headers:
Cache-Control : no-store, no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : bfa8f0e4-059b-49f9-945d-e7ead38a25c8
client-request-id : 42d90d93-a26f-489d-865d-bae424842752
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"DU2PEPF000107E5"}}
Date : Wed, 14 Aug 2024 12:52:30 GMT

Body:
{
"error": {
"code": "generalException",
"message": "General exception while processing",
"innerError": {
"date": "2024-08-14T12:52:30",
"request-id": "bfa8f0e4-059b-49f9-945d-e7ead38a25c8",
"client-request-id": "42d90d93-a26f-489d-865d-bae424842752"
}
}
}

New-MgSiteListItem_Create: General exception while processing

Status: 500 (InternalServerError)
ErrorCode: generalException
Date: 2024-08-14T12:52:30

Headers:
Cache-Control : no-store, no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : bfa8f0e4-059b-49f9-945d-e7ead38a25c8
client-request-id : 42d90d93-a26f-489d-865d-bae424842752
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"DU2PEPF000107E5"}}
Date : Wed, 14 Aug 2024 12:52:30 GMT

DEBUG: [CmdletEndProcessing]: - New-MgSiteListItem end processing.

Configuration

Windows 11

Other information

No response

Lingua principale
C#
Stelle
898
Fork
230
Merge medio
2g 5h
PR unite (30g)
31

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoftgraph/msgraph-sdk-powershell

Tutte le issue di microsoftgraph/msgraph-sdk-powershell

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.