Uploading files to object storage fails #410
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As it says on the tin, whenever I'm trying to upload files it fails, with a
NetworkingError [ERR_INVALID_ARG_TYPE]: The options.agent property must be one of Agent-like Object, undefined, or false. Received an instance of Agentmessage in the logs.I've worked around it by just removing setting the agent here
agent: getAgentByUrl(new URL(u), !meta.objectStorageUseProxy),but something better should get done still.
I think the issue got introduced in
8c9667b2cabut I don't know JS/TS enough to understand what's wrong.The error message seems a bit strange because it's asking for
Agentand then complaining that it actually gotAgent? Though since I don't have or use S3, I cannot test this.As a further note, the
aws-sdkpackage that Foundkey is using is no longer supported as of 2025-09-08 apparently. So even if this gets fixed, the currently used SDK might break at any time I guess.I don't want to do that upgrade because as I said I don't use S3 and thus cannot test it. Also from a cursory look at the documentation (which I found very hard to understand) it seems that the
agentconfiguration is not supported in the new version of the SDK, potentially requiring a large-ish rethink of the approach.The agent is used to:
see also
const defaultAgentOptions = {autoSelectFamily: true,keepAliveTimeout: 30 * SECOND,connect: {lookup: cacheLookup,},};/*** non-proxy agent*/const _http = new Agent(defaultAgentOptions);/*** proxy agent (or non-proxy if no proxy is configured)*/export const httpAgent = config.proxy? new ProxyAgent({...defaultAgentOptions,uri: config.proxy,}): _http;/*** Get agent by URL* @param url URL* @param bypassProxy Allways bypass proxy*/export function getAgentByUrl(url: URL, bypassProxy = false) {if (bypassProxy || (config.proxyBypassHosts || []).includes(url.hostname)) {return _http;} else {return httpAgent;}}