This topic was automatically generated from Slack. You can find the original thread here.
[WARN] web-api:WebClient:0 http request failed getaddrinfo EBUSY slack.com what does this error mean
This topic was automatically generated from Slack. You can find the original thread here.
[WARN] web-api:WebClient:0 http request failed getaddrinfo EBUSY slack.com what does this error mean
The error message [WARN] web-api:WebClient:0 http request failed getaddrinfo EBUSY [slack.com](http://slack.com)
indicates a problem encountered when trying to make an HTTP request to Slack’s API. Specifically, the getaddrinfo EBUSY
part suggests that the system’s DNS resolver could not process the request because it was too busy or overloaded at that moment. This error is not directly related to the Slack API itself but rather to the environment from which the request is being made. It could be a temporary issue with the network, the DNS resolver settings, or system resources being overutilized at the time of the request. To troubleshoot this issue, you might consider the following steps: 1. Retry the Request: Sometimes, simply retrying the request after a short delay can resolve the issue if it was caused by a temporary overload. 2. Check System Resources: Ensure that the system making the request has sufficient resources and is not overloaded with tasks. 3. Review Network Configuration: Verify that the DNS settings are correctly configured and that there are no network issues that could be causing DNS resolution problems. 4. Use a Different DNS Resolver: Temporarily switch to a different DNS resolver (like Google DNS or Cloudflare DNS) to see if the issue persists, which can help identify if the problem is with the current DNS resolver. If the problem continues despite these troubleshooting steps, it may be beneficial to look into the system logs for any related errors or warnings that could provide more insight into the root cause of the issue.
import { Storage } from ‘@google-cloud/storage’;
import ** as _ from ‘lodash’;
import { WebClient } from ‘/web-api’;
import { GoogleSpreadsheet } from ‘google-spreadsheet’;
import { JWT } from ‘google-auth-library’;
export default defineComponent({
props: {
google_cloud: {
type: “app”,
app: “google_cloud”,
},
slack: {
type: ‘app’,
app: ‘slack’
},
sheetCredentials:{type:“data_store”}
},
async run({ steps, $ }) {
const web =new WebClient(this.slack.$auth.oauth_access_token)
const key = JSON.parse(this.google_cloud.$auth.key_json);
const storage = new Storage({
projectId: key.project_id,
credentials: {
client_email: key.client_email,
private_key: key.private_key,
}
});
**var** sheetCredentials=**await** **this**.sheetCredentials.**get**("projectAccountMapCredentials");
**const** serviceAccountAuth = **new** JWT({
email: sheetCredentials.client_email,
key: sheetCredentials.private_key,
scopes: [
'https://www.googleapis.com/auth/spreadsheets',
],
});
**try**{
console.log("start");
**async** **function** postDataToSheet(sheetData,sheetTitle){
**let** header = _.keys(sheetData[0] || {});
**const** sheet = document.sheetsByTitle[sheetTitle]
**const** rows = **await** sheet.getRows();
**await** Promise.all(rows.map((row) => row.**delete**()));
**await** sheet.setHeaderRow(header)
**let** rowValues = []
**for** (**const** element **of** sheetData) {
rowValues.push(_.values(element))
}
**await** sheet.addRows(rowValues)
}
console.log("end");
}
**catch*(error){
console.log(error.message);
},
}) @U05A7KLNALC instead of importing whole lodash how to import only required things
To import only the required functions from lodash instead of the entire library, you can use named imports for the specific methods you need. In your case, it looks like you’re using _.keys
and _.values
from lodash. Here’s how you can modify your imports: import { keys, values } from 'lodash';
Then, in your postDataToSheet
function, you would use keys
and values
directly without the lodash (_
) prefix: ```
let header = keys(sheetData[0] || {}); // Rest of your code remains the same let rowValues = for (const element of sheetData) { rowValues.push(values(element)) }