halliba / az-pipelines-2-sharepoint

Azure DevOps extension - upload build files to SharePoint Online
GNU General Public License v3.0
9 stars 4 forks source link

[Help needed] Error: CompactToken parsing failed with error code: 80049217 #3

Closed Mirksar closed 1 year ago

Mirksar commented 2 years ago

I'm trying to run the task, but I am getting thei error. Any clues on what I am doing wrong?

2022-06-16T15:29:25.5610280Z ##[section]Starting: Upload files to SharePoint: /Users/runner/work/r1/a 2022-06-16T15:29:25.5624830Z ============================================================================== 2022-06-16T15:29:25.5625340Z Task : Upload files to SharePoint Online 2022-06-16T15:29:25.5625640Z Description : Upload files to SharePoint Online 2022-06-16T15:29:25.5625900Z Version : 0.2.1 2022-06-16T15:29:25.5626140Z Author : halliba (github.com/halliba) 2022-06-16T15:29:25.5626740Z Help : github.com/halliba/az-pipelines-2-sharepoint 2022-06-16T15:29:25.5627250Z ============================================================================== 2022-06-16T15:29:25.9329930Z Found 1 files in '/Users/runner/work/r1/a'. 2022-06-16T15:29:25.9334620Z Copying files to ' 2022-06-16T15:29:25.9338520Z [1/1] Copying 'releasenotes.md' -> 'releasenotes.md' 2022-06-16T15:29:26.4467590Z { Error: CompactToken parsing failed with error code: 80049217 2022-06-16T15:29:26.4570750Z at new GraphError (/Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphError.js:34:28) 2022-06-16T15:29:26.4612970Z ##[error]CompactToken parsing failed with error code: 80049217 2022-06-16T15:29:26.4672030Z at Function.GraphErrorHandler.constructErrorFromResponse (/Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:62:22) 2022-06-16T15:29:26.4771680Z at Function. (/Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:89:48) 2022-06-16T15:29:26.4873110Z at step (/Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/tslib/tslib.js:144:27) 2022-06-16T15:29:26.4973790Z at Object.next (/Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/tslib/tslib.js:125:57) 2022-06-16T15:29:26.5074070Z at /Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/tslib/tslib.js:118:75 2022-06-16T15:29:26.5173970Z at new Promise () 2022-06-16T15:29:26.5276460Z at __awaiter (/Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/tslib/tslib.js:114:16) 2022-06-16T15:29:26.5376830Z at Function.GraphErrorHandler.getError (/Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:85:38) 2022-06-16T15:29:26.5477770Z at GraphRequest. (/Users/runner/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.2.1/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphRequest.js:315:84) 2022-06-16T15:29:26.5577120Z statusCode: 401, 2022-06-16T15:29:26.5658830Z code: 'InvalidAuthenticationToken', 2022-06-16T15:29:26.5687600Z requestId: '086c41ea-9204-411a-ba7b-daeb9568b9de', 2022-06-16T15:29:26.5698410Z date: 2022-06-16T15:29:26.000Z, 2022-06-16T15:29:26.5757690Z body: 2022-06-16T15:29:26.5765140Z '{"code":"InvalidAuthenticationToken","message":"CompactToken parsing failed with error code: 80049217","innerError":{"date":"2022-06-16T15:29:26","request-id":"086c41ea-9204-411a-ba7b-daeb9568b9de","client-request-id":"aeb70f6b-02e9-2a42-b688-0a7fad594d1a"}}' } 2022-06-16T15:29:26.5790680Z ##[section]Finishing: Upload files to SharePoint: /Users/runner/work/r1/a

pri-kise commented 2 years ago

Did you provide a correct clientsecret? image

I had the same error last week, where I forget to set the client id and the client secret.

karolwojcik-eaton commented 2 years ago

HI @pri-kise @halliba I have been having the same error and I have set up the client ID and client secret (with a registered app) however it doesn't appear to work. I'm trying to run an Azure Pipeline where the YAML runs a Python Script on my GitHub, creates a file which I want to Publish using this extension. Can you please explain where exactly I ought to get the client ID and secret and if it's from the Azure app how does it interact with my pipeline - Many Thanks!

pri-kise commented 2 years ago

@karoleaton you create an azure app registration. Then you can add a new client secret in the are Certifactes and Secrets

The Client Id ist the Application Id (see Image)

Those are the values, that you have to set in the AzureAD Settings of the release pipeline.

image

karolwojcik-eaton commented 2 years ago

That did the trick for the error (I had the Certificates & secrets Value in that field by accident) but now I am getting a different error image

karolwojcik-eaton commented 2 years ago

@pri-kise @hallibahow did you source the SharePoint Online drive ID parameter precisely - I believe that's what's causing the above error.. image

pri-kise commented 2 years ago

@karoleaton check out my other issue: https://github.com/halliba/az-pipelines-2-sharepoint/issues/2

halliba commented 2 years ago

hi @karoleaton. I've updated the extension to v0.3.0. You can now also use the SharePoint document libarary URL instead of the driveId. Please see the README.md or my comment here

From your first error message, it looks like you're copying files directly into a SharePoint library without using a target folder. Is that intended? There was a bug that included too many /... That should be fixed now. If you still receive an error, feel free to update this issue.

Thank you!