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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
pbipoweruser123
New Member

error connecting to data source for custom connector

i can connect to the custom connector from powerbi desktop but when i try to refresh the same report from powerbi service.

i have personal model gateway set up and here is the error  i see in the logs:

here is my .pq file:

 

mycustomconnector = [
     TestConnection = () => { "mycustomconnector.Contents" },
     Authentication = [
        OAuth = [
            StartLogin = StartLogin,
            FinishLogin = FinishLogin
        ],
        Implicit = [],
        Key = []
    ],
     Label = Extension.LoadString("DataSourceLabel")
];

DM.PersonalGateway Error: 0 : 2024-07-22T19:25:37.1390490Z DM.PersonalGateway 4e5c0ac6-bab7-45c6-a9f2-93f11a5ff673 50de7f33-79a5-f699-904f-d9acb913fc3c MGTD 6a75046f-dabf-429c-807f-48b2844f78b7 ccce84cc-8255-479e-a8e8-a081762b1b6d ccce84cc-8255-479e-a8e8-a081762b1b6d 8B21C03B [DM.Pipeline.Diagnostics] Exception object created [IsBenign=True]: Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.DataAccessException: An exception encountered while accessing the target data source; ErrorShortName: DataAccessException/Wrapped(ValueException)[HResult=-2146233088]
DM.PersonalGateway Error: 0 : 2024-07-22T19:25:37.1420502Z DM.PersonalGateway 4e5c0ac6-bab7-45c6-a9f2-93f11a5ff673 50de7f33-79a5-f699-904f-d9acb913fc3c MGTD 6a75046f-dabf-429c-807f-48b2844f78b7 ccce84cc-8255-479e-a8e8-a081762b1b6d ccce84cc-8255-479e-a8e8-a081762b1b6d 590DBA9A [DM.Pipeline.Common.TracingTelemetryService] Event: FireActivityCompletedWithFailureEvent (duration=76, err=DataAccessException, rootcauseErrorEventId=0)
DM.PersonalGateway Error: 0 : 2024-07-22T19:25:37.1420502Z DM.PersonalGateway b0043cc4-653c-425c-a160-fbc904f05ea7 50de7f33-79a5-f699-904f-d9acb913fc3c MGEC 6a75046f-dabf-429c-807f-48b2844f78b7 ccce84cc-8255-479e-a8e8-a081762b1b6d ccce84cc-8255-479e-a8e8-a081762b1b6d 590DBA9A [DM.Pipeline.Common.TracingTelemetryService] Event: FireActivityCompletedWithFailureEvent (duration=96, err=DataAccessException, rootcauseErrorEventId=0)
DM.PersonalGateway Error: 0 : 2024-07-22T19:25:37.1420502Z DM.PersonalGateway 41f85316-c257-4027-a28c-ff3e6f967d69 50de7f33-79a5-f699-904f-d9acb913fc3c MGPP 6a75046f-dabf-429c-807f-48b2844f78b7 ccce84cc-8255-479e-a8e8-a081762b1b6d ccce84cc-8255-479e-a8e8-a081762b1b6d 590DBA9A [DM.Pipeline.Common.TracingTelemetryService] Event: FireActivityCompletedWithFailureEvent (duration=108, err=DataAccessException, rootcauseErrorEventId=0)
DM.PersonalGateway Error: 0 : 2024-07-22T19:25:37.1530498Z DM.PersonalGateway d5f1e4e3-81ee-405c-841c-e6585afdd089 50de7f33-79a5-f699-904f-d9acb913fc3c MDSR 6a75046f-dabf-429c-807f-48b2844f78b7 ccce84cc-8255-479e-a8e8-a081762b1b6d ccce84cc-8255-479e-a8e8-a081762b1b6d 4C1EF73E [DM.GatewayCore] Error processing request: [0]Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.DataAccessException: An exception encountered while accessing the target data source

GatewayPipelineErrorCode=DM_GWPipeline_Gateway_DataSourceAccessError
GatewayVersion= --->
[1]Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.GatewayPipelineWrapperException: Substituted: ValueException:<ccon>[Expression.Error] 1 arguments were passed to a function which expects 0.</ccon>

GatewayPipelineErrorCode=DM_GWPipeline_UnknownError
GatewayVersion=
InnerType=ValueException
InnerMessage=<ccon>[Expression.Error] 1 arguments were passed to a function which expects 0.</ccon>
InnerToString=<ccon>Microsoft.Mashup.Engine1.Runtime.ValueException: [Expression.Error] 1 arguments were passed to a function which expects 0.
at Microsoft.Mashup.Engine1.Runtime.FunctionValue.Invoke(Value arg0)
at Microsoft.Mashup.Engine1.Runtime.Extensibility.ExtensionResourceKindInfo.CreateTestConnectionFormula(String resourcePath)

 

 

1 ACCEPTED SOLUTION

I figured out the problem. My function was made to accept optional parameter and I was not passing it in test connection.. I just started passing something dummy there and it started working 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi, @pbipoweruser123 

I checked your error and you can check if your custom connector is correct in parameter passing.
You are currently passing a parameter to a function that expects a value of zero. You should check your function to make sure it is implemented correctly, e.g. if it really doesn't need to accept parameters, you should either accept your parameter in the right place or pass in a 0 parameter for the current function to run properly.
To further confirm the problem, you can keep a copy of your custom connector and then try to simplify the connector code to isolate the problem. For example, use authorization validation as one unit of test and request data as another, and then test separately in which unit the problem occurs. Perform further testing within the unit.

vjianpengmsft_0-1721699681550.png

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I figured out the problem. My function was made to accept optional parameter and I was not passing it in test connection.. I just started passing something dummy there and it started working 

Anonymous
Not applicable

Hi, @pbipoweruser123 

Thank you very much for your reply. You can mark your reply as a solution so that others in the community can quickly find an answer if they have a similar problem with a custom connector.

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.