Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal error encountered. - not catchable #932

Open
chiragvels opened this issue Aug 11, 2023 · 17 comments
Open

Internal error encountered. - not catchable #932

chiragvels opened this issue Aug 11, 2023 · 17 comments
Assignees
Labels
question Further information is requested triage Need triage

Comments

@chiragvels
Copy link

[DO NOT INCLUDE ANY PERSONAL OR SENSITIVE DATA - MAKE SURE TO REDACT CONTENT WHEN NECESSARY]

Your question:
The encountered internal error is not catchable. I attempted to catch the error using various methods, but but it was not catchable. Instead, it simply breaks the cron process.

try {
     $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
} catch (GoogleAdsException $googleAdsException) {
            throw $googleAdsException;
        } catch (ApiException $apiException) {
            throw $apiException;
        } catch (Exception $e) {
            throw $e;
        }

Private Reply by forum:

Can you confirm if you are using the PHP client library? If yes, with regards to your concern, since your concern is more on the code implementation on how to catch this kind of exception error in the Google Ads API PHP client library, you may try reaching out to the developer who maintains our client libraries PHP (Github Issues) via this link (https://github.com/googleads/google-ads-php/issues) for further insights on how to catch this kind of error.

Reference: https://groups.google.com/g/adwords-api/c/tkvPnT-fmMo/m/IYS31igSAgAJ

How I can catch error which falls under Internal error encountered.

Thanks,

@chiragvels chiragvels added question Further information is requested triage Need triage labels Aug 11, 2023
@chiragvels
Copy link
Author

Hello,

May I receive some assistance here, please?

Thanks

@fiboknacky
Copy link
Member

Hello Chirag,

Sorry for keeping you waiting. I didn't realize you've created this issue. Will take a look soon.
By the way, you used Google Ads API v13 with grpc, correct?
Would you mind sharing other information like the grpc, protobuf and gax-php version?
And do you still face this issue when running the same query? (I can check your query internally, so you don't need to share it here)

Knack

@fiboknacky fiboknacky self-assigned this Aug 22, 2023
@chiragvels
Copy link
Author

chiragvels commented Aug 22, 2023

Hello Knack,

Sorry for keeping you waiting. I didn't realize you've created this issue. Will take a look soon.

  • No problem. Thanks for taking a look at this.

By the way, you used Google Ads API v13 with grpc, correct?

Yes correct.

Would you mind sharing other information like the grpc, protobuf and gax-php version?

================= PHP EXTENSION INFORMATION
The PHP Extension grpc is installed: 1.54.0
The PHP Extension protobuf is installed: 3.22.3
PHP Version => 8.1.2-1ubuntu2.13
"x-goog-api-client": "gl-php/8.1.2-1ubuntu2.13 gccl/20.0.0 gapic/20.0.0 gax/1.19.1 grpc/1.54.0 rest/1.19.1 pb/3.22.3+c",

And do you still face this issue when running the same query? (I can check your query internally, so you don't need to share it here)

  • yes I am still facing issue. But It is random with different customerIds.
  • Recent request ID:"xeFxg2dKwa3-PSxNXlMIHA"

@fiboknacky
Copy link
Member

Could you please also share the version of google/gax too? Thanks.

@chiragvels
Copy link
Author

chiragvels commented Aug 22, 2023

I have also included the gax version information in my previous response.

gax/1.19.1

"name": "google/gax",
           "version": "v1.19.1",
           "source": {
               "type": "git",
               "url": "https://github.com/googleapis/gax-php.git",
               "reference": "30f6b307faa9858bf58d967664467098dbbc354f"
           },

@fiboknacky
Copy link
Member

fiboknacky commented Aug 23, 2023

Hi Chirag,

I'm trying to reproduce the error you got, but so far I cannot do it yet.

Having said that, from the error you shared on the forum, it looks like the library should be able to recognize the error because the type is google.ads.googleads.v13.errors.googleadsfailure-bin.

Digging deeper, I think that the internal error you got probably is not an ApiException instance, and probably falls out of this if clause. And what you saw is probably just an error message thrown up from the bottom of the stack by the throw statement.

Could you help me verify this? Maybe you can add something around that if clause to check if my assumption is true.
If yes, we can think about adding support for this internal error going forward. Thanks!

@chiragvels
Copy link
Author

Hi Knack,

Could you help me verify this? Maybe you can add something around [that if clause](https://github.com/googleads/google-ads-
php/blob/e070fbdd5ef18daab3da9d4b5b148d6344efe209/src/Google/Ads/GoogleAds/Lib/V13/ServerStreamingGoogleAdsExceptionMiddleware.php#L95) to check if my assumption is true.

Yes, it is. Yesterday, I encountered an internal error. However, when I attempted to debug the issue, I was unable to reproduce the error while rerunning the same example. As a result, I'm not entirely certain about the nature of the problem.

Thanks,

@fiboknacky
Copy link
Member

OK. Please let me know when you can reproduce it.
For now, I suspect that somehow the internal error thrown by the server wasn't created as an instance of ApiException. And that's why the exception is thrown as is, but I still wonder why it's not at least an instance of Exception, so you can catch it.

If it's not even an Exception, we probably need to dig deeper.

@chiragvels
Copy link
Author

chiragvels commented Oct 2, 2023

I have faced same issue again.

An uncaught Exception was encountered

Type:        Google\Ads\GoogleAds\Lib\V13\GoogleAdsException
Message:     {
    "message": "Internal error encountered.",
    "code": 13,
    "status": "INTERNAL",
    "details": [
        {
            "@type": "google.ads.googleads.v13.errors.googleadsfailure-bin",
            "data": "<Unknown Binary Data>"
        },
        {
            "@type": "grpc-status-details-bin",
            "data": "<Unknown Binary Data>"
        },
        {
            "@type": "request-id",
            "data": "SwfPxA_CISpD_3bpjNnoDA"
        }
    ]
}

I think you are right its not creating instance of ApiException.

Filename: /vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V13/GoogleAdsExceptionTrait.php
Line Number: 75

Backtrace:
	File: /vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V13/GoogleAdsExceptionTrait.php
	Line: 50
	Function: createGoogleAdsException

	File: /vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V13/ServerStreamingGoogleAdsExceptionMiddleware.php
	Line: 96
	Function: throwGoogleAdsException

	File: /vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V13/ServerStreamingGoogleAdsResponseMetadataCallable.php
	Line: 63
	Function: readAll

Thanks,

@fiboknacky
Copy link
Member

Is it not even Exception either? That would be a surprise to me.

@chiragvels
Copy link
Author

Yes, This is not even honoured Exception.

@fiboknacky
Copy link
Member

That's weird. We may need to file a bug on the gax-php repo.

@chiragvels
Copy link
Author

Ok.
What details must we include when filing a bug on gax-php repo.?

@fiboknacky
Copy link
Member

Taking a look at your recent report again, it looks like it was thrown as Exception?
So, wasn't it caught at the last catch?

@chiragvels
Copy link
Author

Yes, It wasn't caught at the last catch?

@fiboknacky
Copy link
Member

That's quite weird, since it says that the uncaught exception is Google\Ads\GoogleAds\Lib\V13\GoogleAdsException. It should have been caught at the first catch. 🤔

@chiragvels
Copy link
Author

Yes, But I was getting out of loop when Internal Error encountered and cron jobs are killed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested triage Need triage
Projects
None yet
Development

No branches or pull requests

2 participants