aptly
aptly copied to clipboard
Logging to debug errors
Cannot find logs to debug S3 publishing errors
Detailed Description
When attempting to publish to S3, the error is:
Finalizing metadata files...
ERROR: unable to publish: unable to publish file: error uploading /tmp/aptly499577096/main_binary-amd64_Packages to S3: <region>:<bucket>/: InvalidArgument:
status code: 400,
But there is no log of the response and therefore cannot debug the issue.
Context
If there is an error, a log will help users debug the issue.
Possible Implementation
Print non-200 responses to console or to log file.
Your Environment
Docker, Debian 11.4
FROM debian:11.4 as release-base
WORKDIR /app
# Pull down the scripts to inject secrets into the container (env variables)
RUN apt-get update \
&& apt-get install curl jq gnupg -y \
&& apt-get clean
# Instructions from: http://www.aptly.info/download/
RUN echo "deb http://repo.aptly.info/ squeeze main" > /etc/apt/sources.list.d/aptly.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A0546A43624A8331 && \
apt-get update && \
apt-get install aptly ca-certificates -y && \
apt-get clean
ADD aptly.conf /etc/aptly.conf
VOLUME ["/aptly"]
RUN mkdir /tmp/aptly \
&& aptly repo create repo-1 \
&& aptly repo create repo-2 \
&& aptly repo list
RUN mkdir -p ~/.gnupg \
&& echo "cert-digest-algo SHA256" >> ~/.gnupg/gpg.conf \
&& echo "digest-algo SHA256" >> ~/.gnupg/gpg.conf
{
"rootDir": "/aptly",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"architectures": ["amd64"],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
"downloadSourcePackages": false,
"ppaDistributorID": "ubuntu",
"ppaCodename": "",
"S3PublishEndpoints": {
"test": {
"region": "<region>",
"bucket": "<bucket>",
"endpoint": "",
"awsAccessKeyID": "",
"awsSecretAccessKey": "",
"prefix": "",
"acl": "none",
"storageClass": "",
"encryptionMethod": "",
"plusWorkaround": false,
"disableMultiDel": false,
"forceSigV2": false,
"debug": false
}
}
}
AWS Keys are environment variables and have been proven to work (403 responses before that was fixed).