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

'MissingDefinitionParts' error when attempting to import PBIB report to workspace #286

Closed
denialofself opened this issue Aug 3, 2024 · 4 comments

Comments

@denialofself
Copy link

Using the sample script

# Authenticate
Set-FabricAuthToken -reset

# Ensure workspace exists
$workspaceId = New-FabricWorkspace  -name $workspaceName -skipErrorIfExists

# Import the semantic model and save the item id
$semanticModelImport = Import-FabricItem -workspaceId $workspaceId -path $pbipSemanticModelPath

# Import the report and ensure its binded to the previous imported report
$reportImport = Import-FabricItem -workspaceId $workspaceId -path $pbipReportPath -itemProperties @{"semanticModelId" = $semanticModelImport.Id}

Getting the following error with no indication of what its looking for or how to correct it

Existing items in the workspace: 2
Payload parts:
part: /definition.pbism
part: /diagramLayout.json
part: /model.bim
Creating a new item
Exception: Response status code does not indicate success: 400 (Bad Request).; API error
code: 'MissingDefinitionParts'

@MarcChristiansen
Copy link

I had a similar issue using the sample script on an ubuntu agent.

When I switched to a windows agent it worked fine.

The main difference I saw was in the part listing where ubuntu had "/" in front of every part and it did not have the ".platform" part.

Ubuntu:

Payload parts:
part: /definition.pbism
part: /diagramLayout.json
part: /model.bim
Creating a new item
Exception: Response status code does not indicate success: 400 (Bad Request).; API error
code: 'MissingDefinitionParts'

Windows:

Payload parts:
part: .platform
part: definition.pbism
part: diagramLayout.json
part: model.bim
...
Success

@Jtho28
Copy link

Jtho28 commented Sep 6, 2024

I have discovered that this is an issue with $partPath = $filePath.Replace($itemPathAbs, "").TrimStart("\").Replace("\", "/") in FabricPS-PBIP.psm1. I've made a change to detect the OS and trim ("/") instead on unix systems.

@RuiRomano
Copy link
Collaborator

Thanks! Will look into your PR.

@hettic1
Copy link

hettic1 commented Dec 5, 2024

Update20241218: The error was due to mismatch of the folder name which holds the semanticmodel and report definition.

Folder in the repo: Content
Folder in the YAML file: content

Aligning it fixed the issue.


I have the same error but then running the deploy from a windows machine.
To be more precise.
Azure DevOps:
Image: windows-latest
Agent: Hosted Agent

Response status code does not indicate success: 400 (Bad Request).; API error code: 'MissingDefinitionParts'

At D:\a\1\self\.ado\modules\FabricPS-PBIP.psm1:256 char:25
+                         throw $message
+                         ~~~~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (Response status cod…ingDefinitionParts':String) [], RuntimeException
+ FullyQualifiedErrorId : Response status code does not indicate success: 400 (Bad Request).; API error code: 'MissingDefinitionParts'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants