Skip to content

Commit

Permalink
fix: log detailed error for bucket checking
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed Feb 13, 2023
1 parent b9e5846 commit 8440bc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ RUN ./build.sh
# Final runtime stage.
FROM alpine

RUN mkdir /plugins
COPY --from=builder /opt/bin/plugin_antispam_ocr /plugins/
COPY --from=builder /opt/bin/media_repo /opt/bin/import_synapse /opt/bin/export_synapse_for_import /opt/bin/gdpr_export /opt/bin/gdpr_import /opt/bin/s3_consistency_check /usr/local/bin/

RUN apk add --no-cache \
su-exec \
ca-certificates \
dos2unix \
imagemagick \
ffmpeg

RUN mkdir /plugins
COPY --from=builder /opt/bin/plugin_antispam_ocr /plugins/
COPY --from=builder /opt/bin/media_repo /opt/bin/import_synapse /opt/bin/export_synapse_for_import /opt/bin/gdpr_export /opt/bin/gdpr_import /opt/bin/s3_consistency_check /usr/local/bin/

COPY ./config.sample.yaml /etc/media-repo.yaml.sample
COPY ./docker/run.sh /usr/local/bin/
RUN dos2unix /usr/local/bin/run.sh
Expand Down
4 changes: 2 additions & 2 deletions common/runtime/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package runtime

import (
"fmt"
"github.com/getsentry/sentry-go"

"github.com/getsentry/sentry-go"
"github.com/sirupsen/logrus"
"github.com/turt2live/matrix-media-repo/common/config"
"github.com/turt2live/matrix-media-repo/common/rcontext"
Expand Down Expand Up @@ -73,7 +73,7 @@ func LoadDatastores() {

err = s3.EnsureBucketExists()
if err != nil {
logrus.Warn("\t\tBucket does not exist!")
logrus.Warn("\t\tBucket does not exist!", err)
}

err = s3.EnsureTempPathExists()
Expand Down
2 changes: 1 addition & 1 deletion storage/datastore/ds_s3/s3_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func ParseS3URL(s3url string) (string, string, string, error) {
func (s *s3Datastore) EnsureBucketExists() error {
found, err := s.client.BucketExists(s.ctx, s.bucket)
if err != nil {
return err
return errors.New("error checking if bucket exists: " + err.Error())
}
if !found {
return errors.New("bucket not found")
Expand Down

0 comments on commit 8440bc4

Please sign in to comment.