I’m still dead in the water. The step still fails, though with a different error (see below). This code was working yesterday morning. Any thoughts?
at Request._onResponseBase (file:///tmp/pdg/dist/code/c21e7296192b7c2bcfd791b44fbb77aecf333f0676f478a70df37d961f9b659f/node_modules/.pnpm/got@12.4.1/node_modules/got/dist/source/core/index.js:691:31)
at Request._onResponse (file:///tmp/pdg/dist/code/c21e7296192b7c2bcfd791b44fbb77aecf333f0676f478a70df37d961f9b659f/node_modules/.pnpm/got@12.4.1/node_modules/got/dist/source/core/index.js:750:24)
at ClientRequest.null (file:///tmp/pdg/dist/code/c21e7296192b7c2bcfd791b44fbb77aecf333f0676f478a70df37d961f9b659f/node_modules/.pnpm/got@12.4.1/node_modules/got/dist/source/core/index.js:768:23)
at Object.onceWrapper (events.js:520:26)
at ClientRequest.emit (events.js:412:35)
at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17)
at TLSSocket.socketOnData (_http_client.js:515:22)
at TLSSocket.emit (events.js:400:28)
at null.addChunk (internal/streams/readable.js:293:12)
{
input: undefined,
code: ‘ERR_NON_2XX_3XX_RESPONSE’,
timings: {
start: 1687373490178,
socket: 1687373490181,
lookup: 1687373490183,
connect: 1687373490185,
secureConnect: 1687373490187,
upload: 1687373490187,
response: 1687373490200,
end: 1687373490202,
error: undefined,
abort: undefined,
phases: {
wait: 3,
dns: 2,
tcp: 2,
tls: 2,
request: 0,
firstByte: 13,
download: 2,
total: 24
}
},
name: ‘HTTPError’,
options: {
request: undefined,
agent: { http: undefined, https: undefined, http2: undefined },
h2session: undefined,
decompress: true,
timeout: {
connect: undefined,
lookup: undefined,
read: undefined,
request: undefined,
response: undefined,
secureConnect: undefined,
send: undefined,
socket: undefined
},
prefixUrl: ‘’,
body: undefined,
form: undefined,
json: undefined,
cookieJar: undefined,
ignoreInvalidCookies: false,
searchParams: undefined,
dnsLookup: undefined,
dnsCache: undefined,
context: {},
hooks: {
init: [],
beforeRequest: [],
beforeError: [],
beforeRedirect: [],
beforeRetry: [],
afterResponse: []
},
followRedirect: true,
maxRedirects: 10,
cache: undefined,
throwHttpErrors: true,
username: ‘’,
password: ‘’,
http2: false,
allowGetBody: false,
headers: {
‘user-agent’: ‘got (GitHub - sindresorhus/got: 🌐 Human-friendly and powerful HTTP request library for Node.js)’,
‘accept-encoding’: ‘gzip, deflate, br’
},
methodRewriting: false,
dnsLookupIpVersion: undefined,
parseJson: [Function: parse],
stringifyJson: [Function: stringify],
retry: {
limit: 2,
methods: [ ‘GET’, ‘PUT’, ‘HEAD’, ‘DELETE’, ‘OPTIONS’, ‘TRACE’ ],
statusCodes: [
408, 413, 429, 500,
502, 503, 504, 521,
522, 524
],
errorCodes: [
‘ETIMEDOUT’,
‘ECONNRESET’,
‘EADDRINUSE’,
‘ECONNREFUSED’,
‘EPIPE’,
‘ENOTFOUND’,
‘ENETUNREACH’,
‘EAI_AGAIN’
],
maxRetryAfter: undefined,
calculateDelay: [Function: calculateDelay],
backoffLimit: Infinity,
noise: 100
},
localAddress: undefined,
method: ‘GET’,
createConnection: undefined,
cacheOptions: {
shared: undefined,
cacheHeuristic: undefined,
immutableMinTimeToLive: undefined,
ignoreCargoCult: undefined
},
https: {
alpnProtocols: undefined,
rejectUnauthorized: undefined,
checkServerIdentity: undefined,
certificateAuthority: undefined,
key: undefined,
certificate: undefined,
passphrase: undefined,
pfx: undefined,
ciphers: undefined,
honorCipherOrder: undefined,
minVersion: undefined,
maxVersion: undefined,
signatureAlgorithms: undefined,
tlsSessionLifetime: undefined,
dhparam: undefined,
ecdhCurve: undefined,
certificateRevocationLists: undefined
},
encoding: undefined,
resolveBodyOnly: false,
isStream: true,
responseType: ‘text’,
url: URL {
href: ‘https://uc6fa8c74f3cd98af6d117bbea34.dl.dropboxusercontent.com/cd/0/get/B-Z4daSBMLv93D8dKnuLINzAKkzqcXwAAW3N3lePveJH6ZwFVNlK43QJB-Fi1vvRNgJnZNukiz7-k5wLCWB29_SLB4tIbCBZYPCnvVPYJzxsPO6kbW0zNBHPLEmsnHFrSUoFeq3Rxbpk4I4vNMrY5VXXtFRW5ysyA6JmmAmHWIL2DWC0fLyPwb6g0M5Xsw8SLAk/file’,
origin: ‘https://uc6fa8c74f3cd98af6d117bbea34.dl.dropboxusercontent.com’,
protocol: ‘https:’,
username: ‘’,
password: ‘’,
host: ‘uc6fa8c74f3cd98af6d117bbea34.dl.dropboxusercontent.com’,
hostname: ‘uc6fa8c74f3cd98af6d117bbea34.dl.dropboxusercontent.com’,
port: ‘’,
pathname: ‘/cd/0/get/B-Z4daSBMLv93D8dKnuLINzAKkzqcXwAAW3N3lePveJH6ZwFVNlK43QJB-Fi1vvRNgJnZNukiz7-k5wLCWB29_SLB4tIbCBZYPCnvVPYJzxsPO6kbW0zNBHPLEmsnHFrSUoFeq3Rxbpk4I4vNMrY5VXXtFRW5ysyA6JmmAmHWIL2DWC0fLyPwb6g0M5Xsw8SLAk/file’,
search: ‘’,
searchParams: URLSearchParams {},
hash: ‘’
},
pagination: {
transform: [Function: transform],
paginate: [Function: paginate],
filter: [Function: filter],
shouldContinue: [Function: shouldContinue],
countLimit: Infinity,
backoff: 0,
requestLimit: 10000,
stackAllItems: false
},
setHost: true,
maxHeaderSize: undefined,
signal: undefined,
enableUnixSockets: true
}
}
Here’s the code:
mport stream from “stream”;
import { promisify } from “util”;
import fs from “fs”;
import got from “got”;
export default defineComponent({
async run({ steps, $ }) {
// Workflow only supports files <100mb, so break out if the file is larger.
if (steps.trigger.event.size > 100000000) {
throw new Error(“File is too large. Files must be mp3 or m4a filels under 100mb”)
}
try {
// Define the mimetype
const mime = steps.trigger.event.path_lower.match(/.\w+$/)[0]
// Check if the mime type is supported (mp3 or m4a)
if (mime !== ‘.mp3’ && mime !== ‘.m4a’) {
throw new Error(“Unsupported file type. Only mp3 and m4a files are supported.”);
}
// Define the tmp file path
const tmpPath = /tmp/recording${mime}
// Download the audio recording from Dropbox to tmp file path
const pipeline = promisify(stream.pipeline);
await pipeline(
got.stream(steps.trigger.event.link),
fs.createWriteStream(tmpPath)
);
// Create a results object
const results = {
“tmpPath”: tmpPath,
“mimetype”: mime
}
return results
} catch (error) {
// Log the error and return an error message or handle the error as required
console.error(error);
throw error;
}
}
})