-
Notifications
You must be signed in to change notification settings - Fork 399
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
Assets missing + nondeterministic build (probable regression?) #2018
Comments
Looking at the code it looks weird, that the variable which is there to "avoid watches getting cutoff" here: nest-cli/lib/compiler/assets-manager.ts Lines 118 to 119 in 840b54d
is set to nest-cli/lib/compiler/assets-manager.ts Lines 28 to 33 in 840b54d
|
Hi there! Same thing happening here: sometimes in my deploys in aws beanstalk, the assets folder is missing in one of the instances. Never happened in my local environment, so could not reproduce it yet. Nest version: 9.2.0 |
Hi everyone! I've been struggling with this bug several times since my last post, so I fixed it ensuring that every asset is copied to the production Before: Where:
It's been a couple of weeks since I deployed it and had no problems since then. Hope it helps! |
We are experiencing the same, making deployment very unreliable. It happens on @kamilmysliwiec is there anything that come to your mind that would help fixing / workaround this issue? |
Same here with |
Would you like to create a PR for this issue? |
same here (for a handfull of Occuring on Azure DevOps Ubuntu Build Agents. We have a {
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"assets": [
{
"include":"**/*.hbs",
"outDir":"dist/src",
"watch":true
}
]
}
} |
@earloc can you point me out to some of those postbuild scripts ? |
@pintxxo Basically just anything, which relies on the files being copied to the destination. Really nothing special. We are calling a utility script, which generates our open-API Definition by basically utilizing Somebody even prepended the call to this Script with a |
Is there an existing issue for this?
Current behavior
This is a probable regression from already closed issues (see below). When machine is slow or slowed down, sometimes not all assets will get copied. This creates non deterministicly faulty outputs for NestJS builds.
This means when you are for example building Docker image using BuildKit, which has parallel execution, a CPU and HDD intensive task of another Docker build step will cause part of your assets not being copied.
As a direct consequence part of your application will not be working as usual. Also as this not being a code part, it will probably not fail during startup and you will learn the hard way, e.g. users not being able to register, because the HTML file with validation email cannot be loaded.
This was discussed previously in #1828 and #749 and it was presumably caused by the timeout in assets manager on L26. Also the note on L25 actually suggests this could happen for large files.
nest-cli/lib/compiler/assets-manager.ts
Lines 24 to 37 in 840b54d
Minimum reproduction code
The issue seems the same as before and the reproduction code will be hard to create, as it is a concurrency issue with other processes. So would like to discuss if it's needed before coding.
Steps to reproduce
Expected behavior
All assets must be in the build no matter the build time.
Package version
9.3.0
NestJS version
9.4.0
Node.js version
18.14.2
In which operating systems have you tested?
Other
At least the
timeoutMs
should be configurable in nest-cli.json or somewhere, but I think by default the copy process should never be killed before finishing.The text was updated successfully, but these errors were encountered: