SoftwareBrothers / adminjs

AdminJS is an admin panel for apps written in node.js
https://adminjs.co
MIT License
8.21k stars 662 forks source link

Error: ENOENT: no such file or directory, mkdir #433

Closed MichaelLeeHobbs closed 3 years ago

MichaelLeeHobbs commented 4 years ago

Describe the bug Error: ENOENT: no such file or directory, mkdir seems to be logged about once per initial navigation to a resource.

Installed libraries and their versions

  "dependencies": {
    "admin-bro": "^2.2.12",
    "admin-bro-expressjs": "^2.0.5",
    "admin-bro-sequelizejs": "^0.4.1",
    "aws-sdk": "^2.666.0",
    "cron": "^1.7.2",
    "cron-parser": "^2.13.0",
    "dotenv": "^8.2.0",
    "express": "^4.17.1",
    "express-fileupload": "^1.1.7-alpha.3",
    "express-formidable": "^1.2.0",
    "fs-extra": "^8.1.0",
    "json2csv": "^4.5.4",
    "mirth-api": "^0.0.5",
    "moment": "^2.24.0",
    "morgan": "^1.10.0",
    "node-fetch": "^2.6.0",
    "nodemailer": "^6.3.1",
    "pg": "^7.14.0",
    "sequelize": "^5.21.2",
    "swagger-jsdoc": "^4.0.0",
    "vm2": "^3.8.4"
  }

To Reproduce Steps to reproduce the behavior:

  1. Recreate container.

Expected behavior Probably a better error message so we can identify the issue. I suspect something is not being waited on as it should be. This only happens about once per resource. I was not able to identify where is Admin Bro code this error is coming from but I was able to identify it is from Admin Bro or one of the libraries it calls. This is a very minor issue as everything seems to work fine.

AdminBroOptions with schema

{
        databases: [db],
        resources: [
            {
                resource: db.Report,
                options: {
                    properties: {
                        script: {
                            type: 'textarea',
                            isVisible: { list: false, filter: false, show: true, edit: true },
                        },
                    }
                },
            },
            {
                resource: db.Database,
                options: {
                    properties: {
                        alias: {isTitle: true},
                    }
                },
            },
        ],
        rootPath: '/admin',
    }

Desktop (please complete the following information if relevant):

Additional context None really seems to work fine other than the one time error.

wojtek-krysiak commented 4 years ago

I think that this is where it is thrown:

https://github.com/SoftwareBrothers/admin-bro/blob/a8bd1380986fb3845859a937c519d9b37dbb976c/src/backend/bundler/user-components-bundler.ts#L15-L19

I will try to change that to fs.promises and add better error

wojtek-krysiak commented 4 years ago

BTW it sems that fs somehow cannot create .adminbro tmp dir on your OS.