Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
this has been troubling me for a while now.
I can import from folder, if the folder is local.
But if it is on the network server, same domain, with permissions set to me as R/W, I cannot do nothing.
All I get is this message:
Unexpected error: Operation is not valid due to the current state of the object.
Details:
Microsoft.Mashup.Evaluator.Interface.ErrorException: Operation is not valid due to the current state of the object. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.
at Microsoft.Mashup.Engine1.Library.File.FileHelper.GetAccessControlEntries(AccessControlEntriesCache cache, String fullName, Boolean directory, FileSystemRights rights)
at Microsoft.Mashup.Engine1.Runtime.RecordValue.DemandRecordValue.get_Item(Int32 index)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass68_0.<WriteMetaField>b__0()
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteMetaRecord(IRecordValue value, Boolean truncatedValue)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteValueEnd(IValue value, IRecordValue meta, Boolean truncated)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteLimitedValue(IValue value)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass108_0.<WritePreviewFieldValue>b__0()
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass99_2.<WritePreviewTable>b__2()
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass99_1.<WritePreviewTable>b__1()
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewTable(IValue value)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewValue(IValue value, Int32 serializeStructuredValueDepth)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.SerializePreviewValue(IEngine engine, IValue value, Action`2 rowCountCallback, Nullable`1 options)
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.SerializeRows(Int32 count)
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__DisplayClass0_0.<RunStub>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass11_0.<TryReportException>b__1()
at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host, IHostTrace trace, Action action)
at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.RunStub(IEngineHost engineHost, IMessageChannel channel, Func`1 getPreviewValueSource)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass12_1`1.<OnBeginGetResult>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)
Now for the folder that is given permissions to everyone, it works, but I cannot make my network admins do this for the all foders.
So, what I must change on the folder, for this to work?
we are having the same problem, it doesnt work for existing shares, so i create a new one (PowerBIDataSource) with domain users have read/write. it is not relate to folder depth, folder name length, but root folder permissions somehow as the existing shares might have inconsistent permissions, but the error isnt much helpful.
working
\\file1\PowerBIDataSource\PortfolioCompletion\ASA Index\test\su_9475_13586_map
\\file1\PowerBIDataSource\PortfolioCompletion\ASA Index\su_9475_13586_map
not working
\\file1\db2\Power BI\PortfolioCompletion\ASA Index\su_9475_13586_map
\\file1\db2\yuantest\su_9475_13586_map
Feedback Type:
Frown (Error)
Error Message:
Error
Stack Trace:
Microsoft.Mashup.Evaluator.Interface.ErrorException: Operation is not valid due to the current state of the object. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.
at Microsoft.Mashup.Engine1.Library.File.FileHelper.GetAccessControlEntries(AccessControlEntriesCache cache, String fullName, Boolean directory, FileSystemRights rights, Func`1 impersonate)
at Microsoft.Mashup.Engine1.Library.File.FileModule.FolderContentsRecordValue.<>c__DisplayClass2_0.<New>b__5(Int32 index)
at Microsoft.Mashup.Engine1.Runtime.RecordValue.DemandRecordValue.get_Item(Int32 index)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass68_0.<WriteMetaField>b__0()
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteMetaRecord(IRecordValue value, Boolean truncatedValue)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteValueEnd(IValue value, IRecordValue meta, Boolean truncated)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteLimitedValue(IValue value)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass108_0.<WritePreviewFieldValue>b__0()
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass99_2.<WritePreviewTable>b__2()
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass99_1.<WritePreviewTable>b__1()
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewTable(IValue value)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewValue(IValue value, Int32 serializeStructuredValueDepth)
at Microsoft.Mashup.Evaluator.Services.ValueSerializer.SerializePreviewValue(IEngine engine, IValue value, Action`2 rowCountCallback, Nullable`1 options)
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.SerializeRows(Int32 count)
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__DisplayClass0_0.<RunStub>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass11_0.<TryReportException>b__1()
at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host, IHostTrace trace, Action action)
at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.RunStub(IEngineHost engineHost, IMessageChannel channel, Func`1 getPreviewValueSource)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass12_1`1.<OnBeginGetResult>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)
Stack Trace Message:
Error
Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)
at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.GetStackTraceInfo(Exception e)
at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass14_0.<HandleException>b__0()
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.PowerBI.Client.Windows.Utilities.UIBlockingAwareExceptionHandler.HandleException(Exception e)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.HandleImportEvaluationException(ExceptionResult exceptionView, Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.OnGetPreviewResult(PreviewResult preview, Query query, String sourceID, String formulaTitle, Nullable`1 explicitImportDestination, Boolean isNewQuery, Boolean isFromEditor)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.GetPreviewResult(Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor, Nullable`1 explicitImportDestination)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.<>c__DisplayClass78_1.<OnQuerySettingsResolved>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.<>n__0(IWindowHandle owner)
at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_0.<Main>b__1()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)
Model Default Mode:
Empty
I used network folders a lot, never had an issue as long as they had a path like local folder, e.g.
Z:\NetworkFolder\
is that the case?
or is the format more like:
Domain//NetworkDrive/NetworkFolder/
you could then try with Web or SharePoint folder connectors, but I always had to change it more 'local' version of the path - can you map this drive to your pc?
Well if I map it as a local drive, it doesn't help also.
I have one network share that works, but generally they do not.
One share that works is totaly open to everyone.. while others have network policies for different users.. Im just wondering what is actually making the problem, because I can link to specific excel on those shares and everything works.
Its just with folder import, its making problems 😕
so, its not how you reference it.. thanks for the tip, though
\\server\shared folder\folder
it works for just one of the shared folders.
So if I address one excel through the same address, it works..if I address folder, I get the code I put in the first message.
@AgencyPowerBi wrote:
\\server\shared folder\folder
it works for just one of the shared folders.
So if I address one excel through the same address, it works..if I address folder, I get the code I put in the first message.
so iy works if you connect to a specific file in that folder, not to the folder itself, correct?
the reason it works for a file is the code that connects to a file uses File.Contents (or possibly Web.Contents), that can handle both "/" and "\"
let Source = Excel.Workbook(File.Contents("C:\test\file.xlsx"), null, true), Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data] in Sheet1_Sheet
when you connect to the folder this gets generated:
let Source = Folder.Files("C:\test\") in Source
Folder.Files only handles "\" - at least from my experience. You can also try Folder.Contents, but my guess is the result will be the same. If you map the network drive to a local path it should work without problems
Proud to be a Datanaut!
well, this is interesting, because it actually works 🙂
I'll do some more testing, but yeah..
Thing is, if I want to make a data silo for my company, each computer maps network shares differently, and it makes a problem.
That is why I tend to use \\server\share structure.
The thing is.. for one share that works my path is:
= Folder.Files(Source&"\source\TV")
where Source is defined in seperate query as "\\server\share_folder\folder"
and it works for only specific share_folder\folder
on all other shares it doesn't work, so it must be something other than folder.files doesn't recognize "\"
I would like to know what it is, because other solution makes me organizational problems..
Thanks for advice so far, it's been really useful
from my experience "\" is not an issue, "/" never worked for me, but it doesn't seem to be relevant in your case
so you can use Files.Folder for a single folder on a specific server, but not for any other folders on the same server? Interesting indeed, anything special about that folder? connecting to subfolders or higher folders works as well?
I agree mapping is not a sustainable solution, but if it works for you, then it proves it's not an access issue
I find nothing special about it except it has no share policies.. its public to all within domain.
That is why Im asking around 🙂 not sure what could block access to folder.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.