Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container Functions cannot rebuild #9

Open
JacksonBowe opened this issue Nov 11, 2024 · 1 comment
Open

Container Functions cannot rebuild #9

JacksonBowe opened this issue Nov 11, 2024 · 1 comment

Comments

@JacksonBowe
Copy link
Contributor

This function in sst/runtime/handlers.js fails with error. Because of this error Container functions can never be rebuilt after their initial build.

Error: EBUSY: resource busy or locked, rmdir '<PATH>\.sst\artifacts\c8fac2e4493120b801bf978ade5356a1528e0ad2c9'
// handlers.js
async build(functionID, mode) {
    async function task() {
        const func = useFunctions().fromID(functionID);
        if (!func)
            return {
                type: "error",
                errors: [`Function with ID "${functionID}" not found`],
            };
        const handler = result.for(func.runtime);
        const out = path.join(project.paths.artifacts, functionID);
        await fs.rm(out, { recursive: true, force: true }); // This boy right here
        await fs.mkdir(out, { recursive: true });
        bus.publish("function.build.started", { functionID });
        if (func.hooks?.beforeBuild)
            await func.hooks.beforeBuild(func, out);
        const built = await handler.build({
            functionID,
            out,
            mode,
            props: func,
        });
    }
},
"devDependencies": {
        "@tsconfig/node16": "^1.0.4",
        "aws-cdk-lib": "2.161.1",
        "constructs": "10.3.0",
        "sst": "2.44.0",
        "typescript": "^5.2.2"
    }

https://discord.com/channels/983865673656705025/1305445123668181053/1305445123668181053

@JacksonBowe
Copy link
Contributor Author

I'm pretty sure it's because the container isn't being cleaned up. If I go to Docker Desktop and kill the container it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant