SharePoint Online Connection Errors

I’ve recently started having issues with my SharePoint Online connections. Previously they were working well, but since moving to a new SPO site I’m having issues occasionally (but often enough to cause hassle).

Screenshot of my connection nodes:
Screeny1046

My issue is this – I am infrequently getting the following error from the SharePoint Online Connector (Labs) node:

ERROR SharePoint Online Connector (Labs) 3:1086:746 Execute failed: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.Site

This error comes up when I use a flow variable to specify the ‘site’ value or if I use a hardcoded URL.

Here’s where I think the issue stems from – I am using a subsite of a subsite (3rd level). So contoso.sharepoint.com/sites/main_site/subsite1/subsite2/. In my connector config, I have the following:

Screeny1047

Note that I can’t specify the main site and then choose a subsite in the dialog because my account doesn’t have access to the main site or subsite1, so I get an access error. The only way I can connect is to enter the full URL in the site field. Is this causing my occasional errors?

To resolve the issue I either have to restart KNIME, or change some settings in the connector and then change them back, but i can’t automate my workflow if this is required.

Any experts on the SharePoint/O365 integration nodes out there? Thanks!

So, here’s some more information on when it happens in the wild:

The flow is working fine until it hits one of the connector nodes, and then node goes into warning and the error comes up in the console. It’s not a red node error (oddly) but a yellow warning, and it stops the workflow. If I execute a downstream node, the flow starts again like nothing went wrong.

Hi @AndrewDevlin

to help debug this faster: could you provide the Java stack trace that corresponds to the error you are getting? You will find the stack trace in the KNIME log under View > Open KNIME log

Best,
Björn

See below for the trace from the specific error. Let me know if I need to provide more of the log.

2020-12-22 11:47:48,694 : ERROR : KNIME-Worker-474-SharePoint Online Connector (Labs) 3:1093:1083:746 :  : Node : SharePoint Online Connector (Labs) : 3:1093:1083:746 : Execute failed: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.Site
java.lang.ClassCastException: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.Site
	at com.microsoft.graph.requests.extensions.SiteRequest.get(SiteRequest.java:52)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings$SiteSettings.getParentSiteId(SharepointConnectionSettings.java:482)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings$SiteSettings.getTargetSiteId(SharepointConnectionSettings.java:453)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings.getSiteId(SharepointConnectionSettings.java:229)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointFileSystem.<init>(SharepointFileSystem.java:141)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointConnection.<init>(SharepointConnection.java:92)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionNodeModel.execute(SharepointConnectionNodeModel.java:104)
	at org.knime.core.node.NodeModel.executeModel(NodeModel.java:576)
	at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)
	at org.knime.core.node.Node.execute(Node.java:1016)
	at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:558)
	at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
	at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
	at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
	at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
	at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
	at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
2020-12-22 11:47:48,737 : ERROR : KNIME-Worker-472-SharePoint Online Connector (Labs) 3:1093:1082:746 :  : Node : SharePoint Online Connector (Labs) : 3:1093:1082:746 : Execute failed: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.Site
java.lang.ClassCastException: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.Site
	at com.microsoft.graph.requests.extensions.SiteRequest.get(SiteRequest.java:52)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings$SiteSettings.getParentSiteId(SharepointConnectionSettings.java:482)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings$SiteSettings.getTargetSiteId(SharepointConnectionSettings.java:453)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings.getSiteId(SharepointConnectionSettings.java:229)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointFileSystem.<init>(SharepointFileSystem.java:141)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointConnection.<init>(SharepointConnection.java:92)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionNodeModel.execute(SharepointConnectionNodeModel.java:104)
	at org.knime.core.node.NodeModel.executeModel(NodeModel.java:576)
	at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)
	at org.knime.core.node.Node.execute(Node.java:1016)
	at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:558)
	at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
	at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
	at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
	at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
	at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
	at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

Happening for a different KNIME workflow on a different SPO site now too. Trace for that one:

2020-12-23 09:21:34,702 : WARN  : main :  : Node : CSV Writer (Labs) : 0:245 : No connection available. Execute the connector node first.
2020-12-23 09:21:40,065 : WARN  : main :  : Node : Create File Name : 0:215 : Selected directory 'missing' cannot be accessed!
2020-12-23 09:21:40,066 : WARN  : main :  : Node : Create File Name : 0:218 : Selected directory 'missing' cannot be accessed!
2020-12-23 09:21:40,066 : WARN  : main :  : Node : SharePoint Online Connector (Labs) : 0:56 : Not authenticated
2020-12-23 09:21:44,566 : WARN  : KNIME-Worker-554-Microsoft Authentication (Labs) 0:57 :  : Node : RowID : 0:244 : No row key column selected generate a new one
2020-12-23 09:21:45,088 : ERROR : KNIME-Worker-561-SharePoint Online Connector (Labs) 0:56 :  : Node : SharePoint Online Connector (Labs) : 0:56 : Execute failed: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.Site
java.lang.ClassCastException: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.Site
	at com.microsoft.graph.requests.extensions.SiteRequest.get(SiteRequest.java:52)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings$SiteSettings.getParentSiteId(SharepointConnectionSettings.java:482)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings$SiteSettings.getTargetSiteId(SharepointConnectionSettings.java:453)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionSettings.getSiteId(SharepointConnectionSettings.java:229)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointFileSystem.<init>(SharepointFileSystem.java:141)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointConnection.<init>(SharepointConnection.java:92)
	at org.knime.ext.sharepoint.filehandling.node.SharepointConnectionNodeModel.execute(SharepointConnectionNodeModel.java:104)
	at org.knime.core.node.NodeModel.executeModel(NodeModel.java:576)
	at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)
	at org.knime.core.node.Node.execute(Node.java:1016)
	at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:558)
	at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
	at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
	at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
	at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
	at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
	at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

Also, Got a new one on the CSV Writer node now. It’s connected to SharePoint via the filesystem connector:

2020-12-23 09:32:05,883 : ERROR : KNIME-Worker-589-CSV Writer (Labs) 0:245 :  : Node : CSV Writer (Labs) : 0:245 : Execute failed: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.DriveItem
java.lang.ClassCastException: java.io.BufferedInputStream cannot be cast to com.microsoft.graph.models.extensions.DriveItem
	at com.microsoft.graph.requests.extensions.DriveItemRequest.get(DriveItemRequest.java:52)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointPath.fetchDriveItem(SharepointPath.java:158)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointFileSystemProvider.exists(SharepointFileSystemProvider.java:266)
	at org.knime.ext.sharepoint.filehandling.fs.SharepointFileSystemProvider.exists(SharepointFileSystemProvider.java:1)
	at org.knime.filehandling.core.connections.base.BaseFileSystemProvider.existsCached(BaseFileSystemProvider.java:532)
	at org.knime.filehandling.core.connections.base.BaseFileSystemProvider.readAttributes(BaseFileSystemProvider.java:585)
	at java.nio.file.Files.readAttributes(Files.java:1737)
	at org.knime.filehandling.core.connections.FSFiles.exists(FSFiles.java:286)
	at org.knime.base.node.io.filehandling.csv.writer.CSVWriter2NodeModel.createParentDirIfRequired(CSVWriter2NodeModel.java:227)
	at org.knime.base.node.io.filehandling.csv.writer.CSVWriter2NodeModel.execute(CSVWriter2NodeModel.java:143)
	at org.knime.base.node.io.filehandling.csv.writer.CSVWriter2NodeModel.execute(CSVWriter2NodeModel.java:1)
	at org.knime.core.node.NodeModel.executeModel(NodeModel.java:576)
	at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)
	at org.knime.core.node.Node.execute(Node.java:1016)
	at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:558)
	at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
	at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
	at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
	at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
	at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
	at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

I wasn’t able to edit a previous post to add this – the new instance of the error is happening on a site where I am accessing the main SPO site, not a subsite.

Happy New Year, everyone!

I haven’t seen this error in several days now. This is good news, but I’d still like to understand a bit more about what could have caused it before I mark as resolved and put my workflow into Production. Hoping a KNIME team member can help here. Thanks!

Hi @AndrewDevlin

a happy (and healthy) new year to you, too!

Sorry, investigating this takes a little bit longer, it is quite unclear to me how this error can occur and requires some deeper digging through the Microsoft library we are using to access Sharepoint Online.

Best,
Björn

Hello Andrew,
good news we have just released KNIME Analytics Platform 4.3.2 and 4.2.5 which should fix the class cast exception in the Microsoft library.
Bye
Tobias

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.