googleads / google-ads-dotnet

This project hosts the .NET client library for the Google Ads API.

Home Page:https://developers.google.com/google-ads/api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grpc Error

nitheeshls opened this issue · comments

I'm Facing this error from past 3 weeks, while trying to retrieve reports for past 30 days. Here out of 5 reports only 2 got success and for remaining 3 (google_geographic_view, google_keyword_view, google_search_term_view) I'm facing below error.

In addition to this, If I try to extract past 14 days, all reports are generating successfully.

But as per Business requirement I need to generate for Past 30 days.

One or more errors occurred. (Status(StatusCode="Unknown", Detail="Stream removed", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1679110054.275000000","description":"Error received from peer ipv4:142.251.16.95:443","file":"......\src\core\lib\surface\call.cc","file_line":1070,"grpc_message":"Stream removed","grpc_status":2}"))
image

The packages used
image

Note: In Feb,2023 I was able to generate past 90 days data.

Thanks for helping!!!

@nitheeshls try increasing the timeout: E.g.

client.Config.Timeout = 30 * 60 * 1000; // 30 minutes.

@AnashOommen the connection will remain more than 30 min also sometimes but getting the same error. Tried this solution earlier but not working. Is it because of V11.

Possibly. v11 is going away in a day or two. Try upgrading to v13 and see how that goes.

@AnashOommen While trying to update "Google.Ads.GoogleAds.V11.Services" to "Google.Ads.GoogleAds.V13.Services" by upgrading the package to 15.0.1 using NuGet Package manager.

Severity Code Description Project File Line Suppression State
Error NU1605 Warning As Error: Detected package downgrade: Microsoft.Extensions.Logging from 6.0.0 to 3.1.31. Reference the package directly from the project to select a different version.
ElancoCORE-MINT-AdsAPI -> Google.Ads.GoogleAds 15.0.1 -> Google.Ads.GoogleAds.Core 2.1.0 -> Microsoft.Extensions.Logging (>= 6.0.0)
ElancoCORE-MINT-AdsAPI -> Microsoft.Extensions.Logging (>= 3.1.31) ElancoCORE-MINT-AdsAPI C:\Users\02709994\Downloads\rel-1\ElancoCORE-MINT-master\ElancoCORE-MINT-AdsAPI\ElancoCORE-MINT-AdsAPI.csproj 1

How to Resolve this error?

Upgrade ElancoCORE-MINT-AdsAPI dependency of Microsoft.Extensions.Logging to 6.0.0.

@AnashOommen
[2023-03-28T05:19:56.664Z] A host error has occurred during startup operation '813687a0-e0c7-4911-9a31-c4f98b9ef9e5'.

[2023-03-28T05:19:56.816Z] System.Private.CoreLib: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=***************'. The system cannot find the file specified.

after updating those two packages, and cleaned and built the solution and ran the solution

Also I tried with Microsoft.Extensions.Logging to 7.0.0, but same error

Perhaps https://stackoverflow.com/questions/58510301/could-not-load-file-or-assembly-microsoft-extensions-logging-abstractions can help. Try creating a simple application that has the same runtime configuration as your main application, add a dependency to Google.Ads.GoogleAds and make it work. See how the code differs from your main application.

Hi @nitheeshls did your issue get solved?

@AnashOommen No, Still the same issue. We tried with different version of Google.ads.GoogleAds >13 . But in each vesrion I'm facing same issue.

Additional help needed if I'm missing anything or any other workaround solution for this.

Thanks!!

image
do i need to make any changes in .net version in .csproj file, so that the error wiil by pass any suggestions

Try taking the attachment from #501 and let me know how that works. It is a bundled library, and I've tried to downgrade the dependencies as much as possible.

@AnashOommen ,Tried with the above package this time different error

[2023-04-01T14:21:52.434Z] Executed 'GoogleAPITimeTrigger' (Failed, Id=4d5510fc-1c08-41da-8a89-da6947b33ee1, Duration=4984ms)
[2023-04-01T14:21:52.436Z] System.Private.CoreLib: Exception while executing function: GoogleAPITimeTrigger. Google.Ads.GoogleAds: Method not found: 'System.String System.AppDomainSetup.get_ConfigurationFile()'.

I tried with .net 4 and above versions but failed there also different errors are coming in different versions because of dependencies.

System.MissingMethodException
HResult=0x80131513
Message=Method not found: 'System.String System.AppDomainSetup.get_ConfigurationFile()'.
Source=Google.Ads.GoogleAds
StackTrace:
at Google.Ads.Gax.Util.ConfigUtilities.GetAppConfigPath()
at Google.Ads.Gax.Util.ConfigUtilities.GetSection(String sectionName)
at Google.Ads.Gax.Config.ConfigBase.ReadAppConfigSection(String sectionName)
at Google.Ads.GoogleAds.Config.GoogleAdsConfig..ctor()
at ElancoCORE_MINT_AdsAPI.GoogleAPITimeTrigger.Run(TimerInfo myTimer, ILogger log, ExecutionContext context) in C:\Users\02709994\Downloads\ElancoCORE-MINT-AdsAPI\GoogleAPITimeTrigger.cs:line 41
at Microsoft.Azure.WebJobs.Host.Executors.VoidMethodInvoker2.InvokeAsync(TReflected instance, Object[] arguments) at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker2.d__10.MoveNext()

Code :

GoogleAdsConfig googleAdsConfig = new GoogleAdsConfig()
{
DeveloperToken = AzureKeyVaultHelper.GetKeyValue("GoogleDeveloperToken", keyVaultURL),
LoginCustomerId = AzureKeyVaultHelper.GetKeyValue("GoogleLoginCustomerId", keyVaultURL),
OAuth2ClientId = AzureKeyVaultHelper.GetKeyValue("GoogleAPIClientId", keyVaultURL),
OAuth2ClientSecret = AzureKeyVaultHelper.GetKeyValue("GoogleAPIClientSecret", keyVaultURL),
OAuth2RefreshToken = AzureKeyVaultHelper.GetKeyValue("GoogleAPIRefreshToken", keyVaultURL),
};

While debugging, it's throwing the above Exception here.
Please @AnashOommen Provide the solution for this. Thanks for Helping!!

@AnashOommen any solution for the above issues I'm facing.

We need to upgrade for latest function app version