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

Windows + Prisma: Server process exited with code 3765269347 #261

Open
karlhorky opened this issue Sep 8, 2024 · 2 comments
Open

Windows + Prisma: Server process exited with code 3765269347 #261

karlhorky opened this issue Sep 8, 2024 · 2 comments

Comments

@karlhorky
Copy link
Collaborator

karlhorky commented Sep 8, 2024

Originally reported by @Vishal-beep136 in #255 (comment)

Original comment below:


Heyy I was able to install successfully @ts-safeql/eslint-plugin libpg-query without any errors
however it doesn't seems to work, like it's not linting or showing error. I'm using it with Prisma.

I followed this doc prisma

const query = prisma.$queryRaw`SELECT idd FROM users`;

it should display error like -> Error: column "idd" does not exist

I'm not sure what went wrong I believe I've even configured it correct in .eslintrc.js

 module.exports = { 
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: 'tsconfig.json',
    tsconfigRootDir: __dirname,
    sourceType: 'module',
  },
  plugins: ['@typescript-eslint/eslint-plugin', '@ts-safeql/eslint-plugin'],
  rules: {
    ....
    '@ts-safeql/check-sql': [
      'error',
      {
        connections: [
          {
            connectionUrl: process.env.DATABASE_URL,
            migrationsDir: './prisma/migrations',
            targets: [
              { tag: 'prisma.+($queryRaw|$executeRaw)', transform: '{type}[]' },
            ],
          },
        ],
      },
    ],
  },
 }

also EsLint is crashing a lot

[Info  - 12:20:26 PM] ESLint server running in node v20.14.0
[Info  - 12:20:26 PM] ESLint server is running.
[Info  - 12:20:27 PM] ESLint library loaded from: D:\app\backend-nestjs\node_modules\eslint\lib\api.js
migrationPath D:\app\backend-nestjs\prisma\migrations
[Error - 12:20:39 PM] Server process exited with code 3765269347.
[Error - 12:20:39 PM] The ESLint server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Info  - 12:20:39 PM] ESLint server stopped.

Could be that @ts-safeql/eslint-plugin libpg-query aren't compatible with windows OS 😭 ??
or Am I missing something ??

Thanks :)

@karlhorky karlhorky changed the title Prisma: Server process exited with code 3765269347 Windows + Prisma: Server process exited with code 3765269347 Sep 8, 2024
@karlhorky
Copy link
Collaborator Author

@Vishal-beep136

Research the error further

We can first try to find out what this error code 3765269347 means.

It appears that error code 3765269347 is also known as 0xE06D7363, which apparently means:

The diagnostic is that the DllMain() function inside the DLL died due to an unhandled C++ exception

So it appears there is an unhandled C++ exception somewhere in the Windows version of libpg-query, the code path of which is triggered by SafeQL, causing a crash.

Try a more minimal setup

One thing that I would do in your position is first try out your setup with more minimal code.

@ProchaLu also experienced SafeQL crashing on Windows (with a different error code, 3221226505 ), due to invalid SQL:

You can try to first only lint a single file on the command line:

npx eslint backend-nestjs/prisma/migrations/001-users.ts

If that doesn't fail with the same error message, then you can try to expand to other files until you identify which file is causing the problem.

Once you have identified which file is causing SafeQL to crash, then you can check the file contents to see if there is any unusual SQL in there.

Eg. in @ProchaLu's issue linked above, he identified 3 errors which caused crashes with SafeQL on Windows:

  1. missing comma (should be after users.id)
  2. curly brackets instead of parentheses (after ON)
  3. incorrect table name (user instead of users)

So if any of these (or similar) could apply to your situation, then this may explain the SafeQL crashes.

@karlhorky
Copy link
Collaborator Author

I've also reported this in a new libpg-query issue, to surface the crashes over there too:

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