Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Fix #3111, don't create S3 bucket on server startup #3250

Merged
merged 1 commit into from
Aug 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const http = require("http");
const https = require("https");
const gaActivation = require("./ga-activation");
const genUuid = require("nodify-uuid");
const AWS = require("aws-sdk");
const statsd = require("./statsd");
const { notFound } = require("./pages/not-found/server");
const { cacheTime, setCache } = require("./caching");
Expand All @@ -63,26 +62,6 @@ const PROXY_HEADER_WHITELIST = {

const COOKIE_EXPIRE_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days

if (config.useS3) {
// Test a PUT to s3 because configuring this requires using the aws web interface
// If the permissions are not set up correctly, then we want to know that asap
var s3bucket = new AWS.S3({params: {Bucket: config.s3BucketName}});
mozlog.info("creating-s3-bucket", {msg: `creating ${config.s3BucketName}`, bucketName: config.s3BucketName});

// createBucket is a horribly named api; it creates a local object to access
// an existing bucket
s3bucket.createBucket(function() {
var params = {Key: 'test', Body: 'Hello!'};
s3bucket.upload(params, function(error, data) {
if (error) {
mozlog.warn("test-upload-error", {msg: "Error uploading data during test", error, bucketName: config.s3BucketName});
} else {
mozlog.info("test-upload-success", {msg: `Successfully uploaded data to ${config.s3BucketName}/test`, bucketName: config.s3BucketName})
}
});
});
}

function initDatabase() {
let forceDbVersion = config.db.forceDbVersion;
if (forceDbVersion) {
Expand Down