Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Sajeevsahadev
Frequent Visitor

Postgresql and Power BI connection error: An error happened while reading data from the provider

I was connecting to the Postgresql database, after installing npsql, it got connected, and it asked me the server and database name.

I have given

Server: localhost:5432

Database: Test    - The database is already present in the Postgres. Then click OK. Then I am getting this below error: Details: "An error happened while reading data from the provider: 'Exception has been thrown by the target of an invocation.'

 

image.png

 

I have googled, but no luck, kindly guide how to proceed. 

5 REPLIES 5
Danielzshy
Regular Visitor

Clearing "Encrypt Connections" option works for me. 

Path to clear it:

Go to Power Query Editor --> File --> Options and Settings --> Data Source Settings--> Select the data source with error--> Edit Permissions--> Uncheck "Encrypt Connections" --> OK

Anonymous
Not applicable

I'm having the exact same error message with Power BI Desktop version 2.88.1140.0 x64 and version 2.87.1061.0 x64 on trying to connect to a PostgreSQL database version 9.5 .

I read some of the other community posts from 2019 and 2017 and based on those forums, I've tried: running things as administrator; installing Npgsql; deleting and re-entering credentials; verifying VC++ redistributables 2015-2019 (x64)  and .net framework 4.6.2 sdk and targeting are installed, installing and uninstalling PowerBI. No luck so far. A collegue of mine had no issues connecting to his version of Power BI to the same database but we can't pinpoint what in my system is causing the issues.

v-qiuyu-msft
Community Support
Community Support

Hi @Sajeevsahadev,

 

Which Power BI desktop version did you run? When I try the Power BI desktop October version with npgsql 3.2.5 provider, I can get data fine. Please update the desktop to the latest version as ours then test again. 

 

Best Regards,
Qiuyun Yu 

 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-qiuyu-msft
Community Support
Community Support

Hi @Sajeevsahadev,

 

Which npsql version did you installed? Please share the desktop trace log around the time that the error throws out. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-qiuyu-msft

 

Npgsql version is 3.2.5. 

 

Log File: PBIDesktop.12564.2017-10-08T11-59-36-138550

 

DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:50.9995339Z","Action":"CredentialStorage/GetCredentials","Credentials":[["Odbc","database=AMI;driver={PostgreSQL ANSI(x64)};port=5432;server=171.0.0.1","Driver={PostgreSQL ANSI(x64)};Server=171.0.0.1;Port=5432;Database=AMI",298],["Odbc","database=AMI;driver={PostgreSQL ANSI(x64)};port=5432;server=172.0.0.1","Driver={PostgreSQL ANSI(x64)};Server=172.0.0.1;Port=5432;Database=AMI",298],["Odbc","database=AMI;driver={PostgreSQL ANSI(x64)};port=5432;server=127.0.0.1","Driver={PostgreSQL ANSI(x64)};Server=127.0.0.1;Port=5432;Database=AMI",298],["Odbc","database=AMI;driver={PostgreSQL ANSI(x64)};dsn=Excel Files;port=5432;server=localhost","driver={PostgreSQL ANSI(x64)};server=localhost;port=5432;database=AMI;dsn=Excel Files",298],["PostgreSQL","localhost:5432","localhost:5432;AMI",398],["PostgreSQL","http://localhost:5432","http://localhost:5432;AMI",397],["PostgreSQL","http://172.16.10.243:5432","http://172.16.10.243:5432;AMI",397],["PostgreSQL","http://127.0.0.1:5432... (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0012669"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0014326Z","Action":"SharedLocalStorageAccessor/AcquireMutex","ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0000247"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0013472Z","Action":"UISettingsStorage/GetSettings","MetadataSet":[["ShowStartPageForDataInsightsSummit2016","0"],["FileHistory",2],["SSRSFileHistory",2],["showStartPage","1"],["LastKnownPBICloudConfig",2224],["MultiArtifactEditorWindowScale_Left","100"],["MultiArtifactEditorWindowScale_Top","100"],["MultiArtifactEditorWindowScale_Width","1166"],["MultiArtifactEditorWindowScale_Height","528"],["MultiArtifactEditorWindowScale_Maximized","1"],["multiArtifactEditorRibbonQat",444],["FormulaBuilderHistory",452],["DisplayCommandBar","0"],["EditorTaskPaneWidth","266"],["QueriesEditorWindowScale_Left","85"],["QueriesEditorWindowScale_Top","65"],["QueriesEditorWindowScale_Width","1182"],["QueriesEditorWindowScale_Height","544"],["QueriesEditorWindowScale_Maximized","0"],["multiArtifactQueriesEditorRibbonQat",327],["MaxCacheSize","4294967296"],["DisplayFormulaBar","0"],["UseFixedWidthFont","0"],["AlwaysAllowParameterization","0"],["ShowImportCustomVisualSecurityWarningDialog","1"],["DisableNativeDbQueries","0"],["WebPreviewWarningLevel","1"],["DisableUpdateNotification","0"]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0015431"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0029496Z","Action":"PermissionsStorage/GetPermissions","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"PackagePermissions":[false,true,null,null,null],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0000485"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0033224Z","Action":"PackageSessionStorage/GetSessionStorage","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0000630"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0050274Z","Action":"PackageMetadataStorage/GetPackageMetadata","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"PackageMetadata":[[4,6,false],[["AllFormulas",""],[0,0,true,true,[],[],[["Relationships",8]]],["Formula","Section1/Query1"],[4,0,false,false,[],[],[["IsPrivate","1"]]],["Formula","Section1/Query1/Source"],[4,0,false,false,[],[],[]]]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0000864"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0495225Z","Action":"PackageMetadataStorage/UpdateItemMetadata","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"EditVersion":4,"PackageItemUpdates":[[["Formula","Section1/Query1/Source"],false,true,[["Complete","0"],["Complete","0"],["Preview","f86c4f43-3a91-4aad-bf1c-a31471f6b192"],["PreviewFinishedAt","2017-10-08T11:59:51.0494898Z"]]]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0001213"}
DataMashup.Trace Warning: 24579 : {"Start":"2017-10-08T11:59:51.0058034Z","Action":"PackagePartitionAnalysisInfo/SetPreviewValue","Exception":"Exception:\r\nExceptionType: Microsoft.Mashup.Host.Document.Analysis.IncompleteFormulaAnalysisException, Microsoft.Mashup.Document, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\r\nMessage: Input task 'Source' is incomplete.\r\nStackTrace:\n at Microsoft.Mashup.Evaluator.Interface.EvaluationResult2`1.get_Result()\r\n at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)\r\n\r\n\r\n","ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0438834"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0497073Z","Action":"PackageMetadataStorage/UpdateItemMetadata","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"EditVersion":4,"PackageItemUpdates":[[["Formula","Section1/Query1/Source"],true,true,[]],[["Formula","Section1/Query1/Source"],true,false,[]]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0000737"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0049980Z","Action":"PackagePartitionAnalysisInfo/TryGetComplete","ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0448595"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0499187Z","Action":"PackageMetadataStorage/GetPackageMetadata","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"PackageMetadata":[[4,8,false],[["AllFormulas",""],[0,0,true,true,[],[],[["Relationships",8]]],["Formula","Section1/Query1"],[4,0,false,false,[],[],[["IsPrivate","1"]]],["Formula","Section1/Query1/Source"],[4,0,true,true,[["Complete","0"],["Complete","0"],["Preview","f86c4f43-3a91-4aad-bf1c-a31471f6b192"],["PreviewFinishedAt","2017-10-08T11:59:51.0494898Z"]],[],[]]]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0000812"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0501086Z","Action":"PackageSessionStorage/GetSessionStorage","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0000396"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0501725Z","Action":"PackageMetadataStorage/MarkPackageMetadataComplete","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"EditVersion":4,"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0000443"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0501375Z","Action":"PackageStorage/Access","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0001008"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0033677Z","Action":"PackageStorage/Access","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0469999"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:50.9921310Z","Action":"PackageStorage/Access","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":32,"Duration":"00:00:00.0583149"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0892664Z","Action":"PackageSessionStorage/GetSessionStorage","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":1,"Duration":"00:00:00.0000845"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0893360Z","Action":"PackageStorage/Access","PackageReference":[["b0ebf7cc-dc59-4429-85f7-95c1ff4b445e"],[2]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":1,"Duration":"00:00:00.0005245"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0900350Z","Action":"SharedLocalStorageAccessor/AcquireMutex","ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":1,"Duration":"00:00:00.0000326"}
DataMashup.Trace Information: 24579 : {"Start":"2017-10-08T11:59:51.0899995Z","Action":"UISettingsStorage/GetSettings","MetadataSet":[["ShowStartPageForDataInsightsSummit2016","0"],["FileHistory",2],["SSRSFileHistory",2],["showStartPage","1"],["LastKnownPBICloudConfig",2224],["MultiArtifactEditorWindowScale_Left","100"],["MultiArtifactEditorWindowScale_Top","100"],["MultiArtifactEditorWindowScale_Width","1166"],["MultiArtifactEditorWindowScale_Height","528"],["MultiArtifactEditorWindowScale_Maximized","1"],["multiArtifactEditorRibbonQat",444],["FormulaBuilderHistory",452],["DisplayCommandBar","0"],["EditorTaskPaneWidth","266"],["QueriesEditorWindowScale_Left","85"],["QueriesEditorWindowScale_Top","65"],["QueriesEditorWindowScale_Width","1182"],["QueriesEditorWindowScale_Height","544"],["QueriesEditorWindowScale_Maximized","0"],["multiArtifactQueriesEditorRibbonQat",327],["MaxCacheSize","4294967296"],["DisplayFormulaBar","0"],["UseFixedWidthFont","0"],["AlwaysAllowParameterization","0"],["ShowImportCustomVisualSecurityWarningDialog","1"],["DisableNativeDbQueries","0"],["WebPreviewWarningLevel","1"],["DisableUpdateNotification","0"]],"ProductVersion":"2.50.4859.782 (PBIDesktop)","ActivityId":"00000000-0000-0000-0000-000000000000","Process":"PBIDesktop","Pid":12564,"Tid":1,"Duration":"00:00:00.0013761"}
DataMashup.Trace Information: 24579 :

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors