Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Invalid data source credential - Data gateway

I am refreshing my datasets through the personal data gateway. After publishing my report, When I go to the Datasets for refreshing, it gives me an error invaild data source credential. When I go to the data set settings data gateway is working fine and connected but in the data source credential OAuth is missing, sometime it does not show me anything but sometime it shows only anonymous and windowimporsination. which gives me the same invalid credential error.

I have python model code in the report and I am using the model output to build report but I am using sharepoint folder or powerBI dataflow to input data in the python model. I think that making issue. I changed my system password, update powerBI version and Data gateway, try to input new password in the report dataset and query But nothing seems to be working.

When I connect only powerBI dataflow and sharepoint report with gateway it works fine. only with python code it gives me trouble.

Is there anything which I can do to connect the data and refresh through the personal data gateway.  Please suggest me some soultion of this. Thanks.

 

3 Replies

  • dax's avatar
    dax
    Community Support

    Hi vikassingh49111,

    According to your description, it seems that when you use python code, the gateway won't work, right? If so, and if possible, could you please inform me your python code? Then I could test this in my environment.

    By the way, Install the Personal Gateway - you need a Personal Gateway installed on the machine where the file is located, and where Python is installed. You could refer to Data Gateway Configuration for Python for details.

    Best Regards,
    Zoe Zhi

    • Anonymous's avatar
      Anonymous
      Not applicable

      I tried to install personal gateway at the same location where my python is installed on my local computer, and I saved my .pbix powerBI file at the same location but still it showing me the same error.

       

       

      The Python script I am using is - 

       

      # 'dataset' holds the input data for this script

      import pickle
      loaded_model = pickle.load(open(r"Y:\ML Models\XGBVWF.dat", "rb"))
      df = dataset
      y_pred = loaded_model.predict(df)
      df['prediction']= y_pred

       

      and advanced editor query is - 

       

      let
      Source = SharePoint.Files("XXXXXXXXX", [ApiVersion = 15]),
      #"ContractTerminationstoPredict.csv_XXXXXXX/ML Test/" = Source{[Name="ContractTerminationstoPredict.csv",#"Folder Path"="XXXXXXX/ML Test/"]}[Content],
      #"Imported CSV" = Csv.Document(#"XXXXXXX/ML Test/",[Delimiter=",", Columns=4, Encoding=1252, QuoteStyle=QuoteStyle.None]),

      #"Run Python script" = Python.Execute("# 'dataset' holds the input data for this script#(lf)#(lf)import pickle#(lf)loaded_model = pickle.load(open(r""Y:\ML Models\XGBVWF.dat"", ""rb""))#(lf)df = dataset#(lf)y_pred = loaded_model.predict(df)#(lf)df['prediction']= y_pred",[dataset=#"Changed Type"]),
      df = #"Run Python script"{[Name="df"]}[Value],

       

       

      The error message is -

       

      Can't refresh your data
      The credentials you provided for the data source are invalid. Please check the credentials for all the data sources.
      Please try again later or contact support. If you contact support, please provide these details.
      Activity IDXXXXXXXXXX
      Request XXXXXXXX
      Correlation IDXXXXXXXXXX
      Status code400
       
      Please suggest if you have other solution of this error.
    • Anonymous's avatar
      Anonymous
      Not applicable

      Also this remove all types of sharepoint connection from other files too, the moment i publish the report from PowerBI desktop to online powerBI.