I am creating email automation platform using gmail api and nodejs. It works fine unless the email list contain >100 emails.
When i try to send the emails i am getting this error
Quota exceeded for quota metric 'Queries' and limit 'Queries per minute per user' of service 'gmail.googleapis.com' for consumer 'project_number:xxxxxxxxxxxxx'.
To send the email I am using the following method
const r = await gmail.users.messages.send({
auth, // coming from google oauth client
userId: "me",
requestBody: {
raw: makeEmailBody( // function to create base64 email body with necessary headers
thread.send_to,
{
address: user.from_email,
name: user.from_name,
},
subject,
template,
thread.id
),
},
});
Information about Usage limits
Per user rate limit 250 quota units per user per second, moving average (allows short bursts).
and
Method--------------------------Quota Units
messages.send-----------------100
In other words, sending 100 emails corresponds to using 10 000 quota units, but you are only allowed to use 250 quota units per second.
This means that you need to slow down your code execution to avoid running into quota issues.
This can be done with an Exponential Backoff logarithm, as explained here.
I met an issue when doing swap on Azure Portal.
There are 2 slots, production and blue in our App Service. And we have 2 instances. Both slots and instances well before swapping. Swap action is swapping blue to production(not swap with preview action).
After swapped, one of instance seems not worked properly. Website logs like this:
06:07:44, 1 request for SiteWarmup, response as 200 OK
06:07:45 ~ 06:07:59, 2 times heartbeat and response as 200 OK
06:08:00 ~ 06:09:27, no request
06:09:28 ~ 06:09:36, 13 requests for our APIs, 200 response but take long time.(about 1 second in normal but over 20 second got here)
06:09:37 ~ 06:11:41, no request again
06:11:42 ~ 06:23:38, bit less than 2000 times requests, all except 10 heartbeat are response as 500 time out, after 230 seconds for each API.
In application log, there are only 213 times records from 06:07:53 to 06:09:36, nothing in later 14 minutes. 202 of all is Token Acquisition operation for Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache, but got same Hash, looks strange for me.
2017-04-19T06:09:34,Information,{my-service-name},d659c0,636281789745216643,0,4252,30,"4/19/2017 6:09:34 AM: 88404b06-f143-4de1-99c1-aa2779516c3b - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.windows.net/{my-domain}/
Resource: https://graph.windows.net
ClientId: {my-client-id}
CacheType: Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache (1 items)
Authentication Target: Client
",00000000-0000-0000-0200-008000000056
2017-04-19T06:09:34,Information,{my-service-name},d659c0,636281789745216643,0,4252,30,4/19/2017 6:09:34 AM: 88404b06-f143-4de1-99c1-aa2779516c3b - TokenCache: Looking up cache for a token...,00000000-0000-0000-0200-008000000056
2017-04-19T06:09:34,Information,{my-service-name},d659c0,636281789745216643,0,4252,30,4/19/2017 6:09:34 AM: 88404b06-f143-4de1-99c1-aa2779516c3b - TokenCache: An item matching the requested resource was found in the cache,00000000-0000-0000-0200-008000000056
2017-04-19T06:09:34,Information,{my-service-name},d659c0,636281789745216643,0,4252,30,4/19/2017 6:09:34 AM: 88404b06-f143-4de1-99c1-aa2779516c3b - TokenCache: 58.305389355 minutes left until token in cache expires,00000000-0000-0000-0200-008000000056
2017-04-19T06:09:34,Information,{my-service-name},d659c0,636281789745216643,0,4252,30,4/19/2017 6:09:34 AM: 88404b06-f143-4de1-99c1-aa2779516c3b - TokenCache: A matching item (access token or refresh token or both) was found in the cache,00000000-0000-0000-0200-008000000056
2017-04-19T06:09:34,Information,{my-service-name},d659c0,636281789745216643,0,4252,30,"4/19/2017 6:09:34 AM: 88404b06-f143-4de1-99c1-aa2779516c3b - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
Access Token Hash: {same-hash}
Refresh Token Hash: [No Refresh Token]
Expiration Time: 4/19/2017 7:07:52 AM +00:00
User Hash: null
",00000000-0000-0000-0200-008000000056
Meanwhile, another instance works well, over 100 requests per minute and no other than 200 OK. process time is also normal, most is less than 1 second.
And I noticed 2 things in Metrics Per Instance monitoring.
this instance has a high CPU usage, 10 times more than another one.
this instance has a Http Queue Length equal to 8.0, but nothing other than 0.0 I can found in other time or other instance.
Then swapped production back to blue, both instances and slots worked again.
It is the first time we met this issue, never happened before on same deployment. Is there any possibility to cause this issue, how can I resolve or avoid it?
Thank you for your advice in advance.
Regards
Kong
I have received the following error when trying to save a DSX Scheduled Job:
Job schedule entry could not be created. Status code: 500
Screenshot of the error message:
I've tried about six times over the last few hours and have consistently received the above error message.
Debugging via the browser network inspection tool I can see:
{
"code":"CDSX.N.1001",
"message":"The service is not responding, try again later.",
"description":"",
"httpMethod":"POST",
"url":"https://batch-schedule-prod.spark.bluemix.net:12100/schedules",
"qs":"",
"body":"While attempting to get Bluemix Token from BlueIDToken, unable to retrieve AccessToken, failed with status 400 Bad Request, message = {\"error\":\"invalid_grant\",\"error_description\":\"A redirect_uri can only be used by implicit or authorization_code grant types.\"} Entity: {\"error\":\"invalid_grant\",\"error_description\":\"A redirect_uri can only be used by implicit or authorization_code grant types.\"}",
"statusCode":500,
"duration":666,
"expectedStatusCode":201
}
As per Charles comment, the functionality is working ok now. I guess if this happens to another user some time in the future they should contact support.
i am integrating netaxept payment gateway in interspire shopping cart but its throwing exception "Refused by issuer" each time i try to porocess the folling line
$OutputParametersOfProcess = $client->__call('Process', array("parameters" => $InputParametersOfProcess));
this is working in sample code but not working for me the only difference i have notice that tha SoapClient sdl Resource id #10 with the sample code and for me is 68 or 69
i am unable to figure out the problem either with SoapClient library or with the service provider.
There should be more info in the return value. Refused by issuer really means that the bank declined your payment.
I don't succeed in making Forums Moodle module sending mails for posts notification.
Although mails sending is working right in Moodle platform, when it comes to Forums module it doesn't work. I executed cron.php from the browser and I got:
Starting activity modules
Processing module function assignment_cron ...done.
Processing module function chat_cron ...done.
Processing module function forum_cron ...Processing user 3
Sending ERROR: SMTP Error: Data not accepted.
Error: mod/forum/cron.php: Could not send out mail for id 13 to user 3 (test.test#test.org) .. not trying again.
post 13: Re: test4
Sending ERROR: SMTP Error: Data not accepted.
Error: mod/forum/cron.php: Could not send out mail for id 14 to user 3 (test.test#test.org) .. not trying again.
post 14: Re: test4
Processing user 4
Sending ERROR: SMTP Error: Data not accepted.
Error: mod/forum/cron.php: Could not send out mail for id 13 to user 4 (test.test#test.org) .. not trying again.
post 13: Re: test4
Sending ERROR: SMTP Error: Data not accepted.
Error: mod/forum/cron.php: Could not send out mail for id 14 to user 4 (test.test#test.org) .. not trying again.
post 14: Re: test4
....
post 19: Re: teacher topic
0 users were sent post 13, 'Re: test4'
0 users were sent post 14, 'Re: test4'
0 users were sent post 15, 'new topic test'
0 users were sent post 16, 'Re: new topic test'
0 users were sent post 17, 'Re: new topic test'
0 users were sent post 18, 'teacher topic'
0 users were sent post 19, 'Re: teacher topic'
Starting digest processing...
Cleaned old digest records
done.
In moodle 1.9 or 2.0 go to Site administration ► Server ► Email to check the SMTP settings.
Click on the moodle docs link at the bottom of this page and it will take you to moodle documentation, where it talks about Email settings, SMTP settings in particular.
If you cant find the link to moodle docs, http://docs.moodle.org/21/en/admin/setting/mail