2

I have integrated bugsnag with my go-service, and it was working good on my local machine; but when I deployed it on server it giving the above error whenever bugsnag try to notify error.

I am deploying it on ec2 with docker container. after exploring Internet I have added below command to my docker file

RUN apk add --no-cache ca-certificates

but this also did not work for me

Below is simplified version of code I am using

package main

import (
    "fmt"
    "github.com/bugsnag/bugsnag-go/v2"
    "time"
)

func init() {
    ConfigureBugsnag()
}

func ConfigureBugsnag() {
    bugsnag.Configure(bugsnag.Configuration{
        APIKey:          "bugsnagKey",
        ReleaseStage:    "stage",
        ProjectPackages: []string{"main", "github.com/myapp"},
    })
}

func main() {

    bugsnag.Notify(fmt.Errorf("Test error"))

    time.Sleep(time.Hour)
}

this is working on local machine but giving the error on server

  • Can you also add the contents of you Dockerfile? – Suyash Medhavi Aug 31 '22 at 15:43
  • Is your server behind a proxy? If that's the case it's possible you haven't set up the $HTTP_PROXY environment variable on your server, so the transport being used by the notifier isn't correctly configured: https://docs.bugsnag.com/platforms/go/other/configuration-options/#transport It may be worth experimenting with the transport configuration to try and isolate the issue. If the above doesn't help please write into support@bugsnag.com and we can try investigate this in more detail.Thanks!” – Bugsnag Support Sep 01 '22 at 08:17

1 Answers1

0

I don't have much explanation: but adding following in the Dockerfile, solved the issue

RUN apk add -U --no-cache ca-certificates
FROM scratch as final
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 14 '22 at 02:07