Repository navigation
Description
Describe the bug.
Asyncapi cli 6.0.0 seems to sometimes crash when invoked many times in parallel in docker. It crashes with the following error:
Error: EEXIST: file already exists, mkdir
'/usr/local/lib/node_modules/@asyncapi/cli/lib/utils/logs'
Code: EEXIST
which suggests that the crash might be caused by the following in logger.ts:
const logDir: string = path.join(__dirname, config.has('log.dir') ? config.get('log.dir') : 'logs');
if (!fs.existsSync(logDir)) {
fs.mkdirSync(logDir);
}
This is extremely unlikely to cause issues on a normal system because the folder gets created once and then never again but that's not the case in a fresh docker container. It's still very rare there, I've seen the crash just once myself and once on a colleague's machine, but it can happen.
Can't contribute a PR sadly because I'm not a TypeScript developer.
Expected behavior
asyncapi not crashing with EEXIST: file already exists, mkdir '/usr/local/lib/node_modules/@asyncapi/cli/lib/utils/logs'
Screenshots
Error log from one of the crashes. Happened as part of cargo build that runs asyncapi generate internally.
109.4 error: failed to run custom build command for `<redacted>`
109.4
109.4 Caused by:
109.4 process didn't exit successfully: `<redacted>` (exit status: 1)
109.4 --- stdout
109.4 cargo::rerun-if-changed=<redacted>
109.4
109.4 --- stderr
109.4 Pre-build failed generating API payloads for <redacted> error: WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
109.4 WARNING: See https://github.com/node-config/node-config/wiki/Strict-Mode
109.4 WARNING: No configurations found in configuration directory:<redacted>
109.4 WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
109.4 Error: EEXIST: file already exists, mkdir
109.4 '/usr/local/lib/node_modules/@asyncapi/cli/lib/utils/logs'
109.4 Code: EEXIST
109.4
109.4 warning: build failed, waiting for other jobs to finish...
How to Reproduce
Wasn't able to reliably reproduce with asyncapi cli outside of our docker image. The following shows a similar error though:
export NPM_CONFIG_PREFIX="$(mktemp -d)"
trap 'rm -rf "$NPM_CONFIG_PREFIX"' EXIT
npm install -g @asyncapi/[email protected]
cd "$(npm root -g)/@asyncapi/cli"
export SUPPRESS_NO_CONFIG_WARNING=true
for round in {1..100}; do
rm -rf lib/utils/logs
for i in $(seq 1 8); do
node -e "require('./lib/utils/logger')" &
done
wait
done
🖥️ Device Information [optional]
No response
👀 Have you checked for similar open issues?
- I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to work on this issue ?
No, someone else can work on it
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Sep 3, 2026
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
devxdh commentedon Sep 3, 2026
@konekohana I'm on it. Thank you for notifying the issue.
devxdh commentedon Oct 7, 2026
@AayushSaini101 Please have a look.
fix: drop unused log dir setup that triggered node-config warnings
frederikb commentedon Oct 28, 2026
Still happens on 6.2.2 when we run
asyncapi validatein parallel in CI after a fresh install. #2324 and #2327 both fix it. Could a maintainer merge one of them?konekohana commentedon Oct 28, 2026
@frederikb until this gets merged, a quick and dirty workaround is to create the folder ahead of time to make sure the buggy condition never evaluates
true: