TabularEditor / TabularEditor3

Bug reports, feature requests, discussion and documentation for Tabular Editor 3 (commercial version).
60 stars 7 forks source link

TMDL Format Error: Parsing error type - invalid line type #1277

Open ppontow opened 2 weeks ago

ppontow commented 2 weeks ago

Description

When saving a Power BI Tabular Model back to the definition folder of an existing Power BI project, the project cannot be opened with Power BI Desktop anymore. I always receive the parsin error of any invalid line type. Please find the full error stack of PBI Desktop in the crash report section below.

Thank you for your help!

Tabular Editor 3 Version

3.14.0

Screenshots

image

Steps to Reproduce

  1. Creating a Power BI project file in PBI Desktop
  2. Add some tables, expressions and so on
  3. Save as pbip with TMDL enabled
  4. Open the definition folder in TE3
  5. Save the model
  6. Try opening it again in PBI Desktop -> fails for me

Expected behavior

I expect to do any modifications with TE3 and open the model back in Power BI Desktop again

Crash Report

Feedback Type:
Frown (Error)

Timestamp:
2024-04-17T08:39:12.8138173Z

Local Time:
2024-04-17T10:39:12.8138173+02:00

Session ID:
add325ae-b86c-419f-b636-0fe0b578e1db

Release:
April 2024

Product Version:
2.128.952.0 (24.04) (x64)

Error Message:
There's a problem with the definition content in your Power BI Project.
TMDL Format Error:
    Parsing error type - InvalidLineType
    Detailed error - Unexpected line type: Other!
    Document - './database'
    Line Number - 1
    Line - 'database 'Master List Report''

Stack Trace:
   at Microsoft.PowerBI.Client.Windows.Services.BiProjectOperationHandler.<LoadFromProject>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerBI.Client.Windows.Services.BiProjectOperationHandler.<LoadFromPbip>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerBI.Client.Windows.Services.BiProjectOperationHandler.<LoadArtifact>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerBI.Client.Windows.Services.CurrentArtifactManager.<ExecuteAndHandleFileOpenErrors>d__48.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerBI.Client.Windows.Services.CurrentArtifactManager.<>c__DisplayClass33_0.<<OpenArtifactAndSetAsCurrent>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.<>c__DisplayClass13_0`1.<<BlockUIAndRun>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.WaitOnUIThreadForTaskCompletion[T](Task`1 task)
   at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.BlockUIAndRun[T](Func`1 asyncMethod)
   at Microsoft.PowerBI.Client.Windows.Services.CurrentArtifactManager.OpenArtifactAndSetAsCurrent(IPowerBIWindowService windowService, IPowerBIArtifact artifactToOpen, IExceptionHandler exceptionHandler, Nullable`1 entryPoint)
   at Microsoft.PowerBI.Client.CommandLineFileService.TryOpenOrCreateReport(IPowerBIWindowService windowService, IExceptionHandler exceptionHandler, Boolean forceCreate)
   at Microsoft.PowerBI.Client.Program.<>c__DisplayClass7_0.<RunApplicationLegacy>b__0()
   at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)

Stack Trace Message:
TMDL Format Error:
    Parsing error type - InvalidLineType
    Detailed error - Unexpected line type: Other!
    Document - './database'
    Line Number - 1
    Line - 'database 'Master List Report''

Invocation Stack Trace:
   at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo..ctor(String message, Exception exception, Nullable`1 stackTraceInfo, String messageDetail)
   at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleKnownExceptions(Exception e)
   at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleException(Exception e)
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
   at Microsoft.PowerBI.Client.Program.RunApplicationLegacy(String[] args)
   at Microsoft.PowerBI.Client.Program.Main(String[] args)

InnerException0.Stack Trace Message:
TMDL Format Error:
    Parsing error type - InvalidLineType
    Detailed error - Unexpected line type: Other!
    Document - './database'
    Line Number - 1
    Line - 'database 'Master List Report''

InnerException0.Stack Trace:
   at Microsoft.PowerBI.Client.Windows.Services.TmdlSchemaContent.GetDatabase()
   at Microsoft.PowerBI.Client.Windows.Services.BiProjectOperationHandler.<LoadFromProject>d__34.MoveNext()

InnerException0.Invocation Stack Trace:
   at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo.GetFeedbackValuesFromException(Exception e, String prefix)
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo.GetFeedbackValuesFromInnerExceptions(Exception e, Int32 depth)
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo.CreateAdditionalErrorInfo(Exception e)
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo..ctor(String message, Exception exception, Nullable`1 stackTraceInfo, String messageDetail)
   at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleKnownExceptions(Exception e)
   at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleException(Exception e)
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
   at Microsoft.PowerBI.Client.Program.RunApplicationLegacy(String[] args)
   at Microsoft.PowerBI.Client.Program.Main(String[] args)

InnerException1.Stack Trace Message:
TMDL Format Error:
    Parsing error type - InvalidLineType
    Detailed error - Unexpected line type: Other!
    Document - './database'
    Line Number - 1
    Line - 'database 'Master List Report''

InnerException1.Stack Trace:
   at Microsoft.AnalysisServices.Tabular.Tmdl.TmdlParser.ObjectContext.ReadObject(TmdlObjectInfo objectInfo)
   at Microsoft.AnalysisServices.Tabular.Tmdl.TmdlParser.ParseDocumentImpl(TmdlSchema schema, ITmdlReader reader, String path, Boolean disposeReader)
   at Microsoft.AnalysisServices.Tabular.Tmdl.TmdlParser.<>c__DisplayClass12_0.<ParseProject>b__0(String logicalPath)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at Microsoft.AnalysisServices.Tabular.Tmdl.TmdlProject..ctor(TmdlContentSource contentSource, IEnumerable`1 documents)
   at Microsoft.AnalysisServices.Tabular.Tmdl.TmdlParser.ParseProject(TmdlContentSource contentSource, TmdlSchema schema, IMetadataDeserializationController controller, Object context)
   at Microsoft.AnalysisServices.Tabular.Serialization.MetadataSerializationContext.TmdlSerializationContext.CreateDatabase(Object context)
   at Microsoft.PowerBI.Client.Windows.Services.TmdlSchemaContent.GetDatabase()

InnerException1.Invocation Stack Trace:
   at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo.GetFeedbackValuesFromException(Exception e, String prefix)
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo.GetFeedbackValuesFromInnerExceptions(Exception e, Int32 depth)
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo.GetFeedbackValuesFromInnerExceptions(Exception e, Int32 depth)
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo.CreateAdditionalErrorInfo(Exception e)
   at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo..ctor(String message, Exception exception, Nullable`1 stackTraceInfo, String messageDetail)
   at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleKnownExceptions(Exception e)
   at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleException(Exception e)
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
   at Microsoft.PowerBI.Client.Program.RunApplicationLegacy(String[] args)
   at Microsoft.PowerBI.Client.Program.Main(String[] args)

OS Version:
Microsoft Windows NT 10.0.22621.0 (x64 en-US)

CLR Version:
4.8 or later [Release Number = 533320]

Peak Virtual Memory:
69.9 GB

Private Memory:
236 MB

Peak Working Set:
688 MB

IE Version:
11.1.22621.0

User ID:
26915632-4aca-489e-b070-44fc8b65ec79

Telemetry Enabled:
True

InnerException0.PowerBINonFatalError_ErrorCode:
DataModelLoadFailed

InnerException0.PowerBINonFatalError_ErrorDescription:
DataModel BOM: System.Text.UTF8Encoding

DPI Scale:
100%

Supported Services:
Power BI

Windows Version

Windows 11 Pro

otykier commented 2 weeks ago

This is a known issue with TMDL, which will be addressed in our next update (due in a week or so). Unfortunately, the default way the TMDL library saves the files includes the UTF-8 BOM (Byte Order Mark). Unfortunately, PBI Desktop expects the files to be saved without the BOM, so we made this the default encoding in our next TE3 release.

In the mean time, you can "uncorrupt" your files by opening the model in the TE2, where no-BOM has been the default since v. 2.23.0.

ppontow commented 1 week ago

Thank you for your quick reply. Using your latest release of TE 2.24.0 helps for the time being. Looking forward to the next TE3 release!

otykier commented 1 week ago

Hi @ppontow Just letting you know that the latest release of Tabular Editor 3 now fixes this issue.

ppontow commented 6 days ago

Hi @otykier Thank you for keeping me in the loop. However, it is not working entirely, yet. I tried saving a model with cultures, however, instead of saving the culture with the culture property, it is saved as cultureInfo which does not seem to be supported by PBI Desktop:

image

Could you please advise? For the time being, I will continue using TE 2 with which it is working perfectly fine...

otykier commented 6 days ago

That’s weird. We’re using exactly the same code to save the model as TMDL in both TE2 and TE3. Which version of TE2 are you comparing to? Did you try the latest 2.24.1 that was released a few days ago?

ppontow commented 6 days ago

I use TE 2.24.0.

ppontow commented 6 days ago

But you are right, with TE 2.24.1 I get the same issue as with TE 3.15 - the culture get saved with the cultureInfo property.