I'm trying to upload a file to Google Cloud Storage, i received notice error :
[ERROR] [ERROR] googleapi: Error 503: Backend Error, backendError
[ERROR] dial tcp 108.177.97.109:587: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
intermittently I'm getting this exception from Google
In my source, at function:
func getGsUtil() (*st.Util, error) {
c := GetMainConfig()
return gcp.NewGSUtil(&gcp.GCPConfig{
PrivateKeyPem: c.GCP.PrivateKeyPem,
Email: c.GCP.Email,
ProjectID: c.GCP.ProjectID,
})
}
AND
func NewGSUtil(cfg *GCPConfig) (*st.Util, error) {
pKeyFilePath := cfg.PrivateKeyPem
if !ext.FileExists(pKeyFilePath) && !filepath.IsAbs(pKeyFilePath) {
pKeyFilePath = filepath.Join(filepath.Dir(os.Args[0]), pKeyFilePath)
}
pemKeyBytes, err := ioutil.ReadFile(pKeyFilePath)
if err != nil {
return nil, err
}
conf := &jwt.Config{
Email: cfg.Email,
PrivateKey: pemKeyBytes,
Scopes: []string{
storage.CloudPlatformScope,
storage.DevstorageReadWriteScope,
},
TokenURL: google.JWTTokenURL,
}
// Initiate an http.Client
client := conf.Client(context.Background())
storageService, err := storage.New(client)
if err != nil {
return nil, err
}
// Verify service by get buckets list
_, err = storageService.Buckets.List(cfg.ProjectID).Do()
if err != nil {
return nil, err
}
mSTUtil := &st.Util{
Service: storageService,
ProjectId: cfg.ProjectID,
}
return mSTUtil, nil
}
after I call this handle the error is returned, i don't know if the error is due to the SMTP mail server or googleapi's service, the error error googleapi is returned first.
I tried searching for this error on google, is it an error connecting to the google service?
I don't know the error how will this be solved.