New-MgSiteItem General Exception While Processing
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the New-MgSiteListItem entry point and reproduce the POST to /sites/{site-id}/lists/{list-id}/items using the payload shown, then compare it with a request that omits Website. Done means a list item containing a hyperlinkOrPicture field can be created without the reported 500 generalException.
Written by the indexing model from the issue text.
Description
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
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
- Dominant language
- C#
- Stars
- 898
- Forks
- 230
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 31
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoftgraph/msgraph-sdk-powershell
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
status:waiting-for-triage type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
status:waiting-for-triage type:bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
status:waiting-for-triage type:bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in microsoftgraph/msgraph-sdk-powershell
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100