Skip to content

ETXTBSY error when running prisma2 dev #1157

Closed

Description

@tvvignesh

This is in reference to the issue here: #966 (comment)

My OS: Ubuntu 19.10

Details:

Linux vignesh-predator 5.3.0-24-generic #26-Ubuntu SMP Thu Nov 14 01:33:18 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Version of Prisma2: [email protected], binary version: 3c4da1d6caa0c40a0210a346ec982c77f74e18c7

Run prisma2 dev and then save the schema.prisma file with/without making any change and my cli throws this error. Have to run prisma2 dev again after this.

Screenshot from 2019-12-16 11-07-41

Data model:

// datasource sqlite {
//     provider = "sqlite"
//     url      = "file:dev.db"
//     default  = true
// }

datasource postgres {
    provider = "postgres"
    url      = "postgresql://user:pwd@localhost:54320/mydb"
    default  = true
}

generator photon {
    provider = "photonjs"
}

model UserAuthentication {
    id          String   @default(cuid()) @id
    emails      String[]
    local       String
    facebook    String
    google      String
    github      String
    microsoft   String
    amazon      String
    status      String
    metadata    String
    tagIDList   String[]
    createdDate DateTime @default(now())
    updatedDate DateTime @updatedAt
}

Originally posted by @tvvignesh in #966 (comment)

Activity

  1. pantharshit00 commented on Dec 17, 2019

    @pantharshit00
    Contributor

    I tried on a digitalocean ubuntu 19.10 box but I was unable to reproduce this.

    Are you able to constantly reproduce this? Can you please the share out in debug mode so that we can get some pointers on what might be the cause of this? To enable debug mode run export DEBUG=* before running the prisma2 command.

  2. added
    bug/0-unknown
    kind/bug
    on Dec 17, 2019
  3. tvvignesh commented on Dec 17, 2019

    @tvvignesh
    ContributorAuthor

    @pantharshit00 It comes on and off - the behavior is not consistent. I did what you said and I got the debug logs. Adding it below. You can see the ETXTBSY error recorded in the logs.

       Studio endpoint: http://localhost:5555/
       ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       d: diff
    2019-12-17T16:08:18.983Z generateClient makeDir: /opt/timecampus/products/timecampus-server/platform/auth/src/app/db/prisma/node_modules/@prisma/photon
    2019-12-17T16:08:18.986Z generateClient Copying /home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x to /opt/timecampus/products/timecampus-server/platform/auth/src/app/db/prisma/node_modules/@prisma/photon/runtime/query-engine-debian-openssl-1.1.x
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":13,\"action\":\"request\",\"data\":{\"query\":\"photon.emailSchemas.count({\\n})\"}}}" +3m
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":14,\"action\":\"request\",\"data\":{\"query\":\"photon.mobileSchemas.count({\\n})\"}}}" +1ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":15,\"action\":\"request\",\"data\":{\"query\":\"photon.userAuthentications.count({\\n})\"}}}" +0ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":16,\"action\":\"request\",\"data\":{\"query\":\"photon.emailSchemas.count({\\n})\"}}}" +4ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":17,\"action\":\"request\",\"data\":{\"query\":\"photon.mobileSchemas.count({\\n})\"}}}" +0ms
      photon Request: +0ms
      photon query {
      photon   aggregateEmailSchema {
      photon     count
      photon   }
      photon } +0ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":18,\"action\":\"request\",\"data\":{\"query\":\"photon.userAuthentications.count({\\n})\"}}}" +0ms
      engine {
      engine   PRISMA_DML_PATH: '/home/vignesh/.cache/prisma/studio/opt-timecampus-products-timecampus-server-platform-auth-src-app-db/schema.prisma',
      engine   PORT: '44319',
      engine   RUST_BACKTRACE: '1',
      engine   RUST_LOG: 'info',
      engine   LOG_QUERIES: 'true',
      engine   OVERWRITE_DATASOURCES: '[]'
      engine } +0ms
      engine {
      engine   cwd: '/opt/timecampus/products/timecampus-server/platform/auth/src/app/db/prisma'
      engine } +0ms
      photon Request: +4ms
      photon query {
      photon   aggregateMobileSchema {
      photon     count
      photon   }
      photon } +0ms
      photon Request: +1ms
      photon query {
      photon   aggregateUserAuthentication {
      photon     count
      photon   }
      photon } +0ms
      photon Request: +0ms
      photon query {
      photon   aggregateEmailSchema {
      photon     count
      photon   }
      photon } +0ms
      photon Request: +0ms
      photon query {
      photon   aggregateMobileSchema {
      photon     count
      photon   }
      photon } +0ms
      photon Request: +0ms
      photon query {
      photon   aggregateUserAuthentication {
      photon     count
      photon   }
      photon } +0ms
      express:router dispatching GET / +3m
      express:router query  : / +0ms
      express:router expressInit  : / +1ms
      express:router <anonymous>  : / +0ms
      express:router serveStatic  : / +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/server.html" +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/server.html" +1ms
      send accept ranges +0ms
      send content-type text/html +0ms
      express:router dispatching GET /studioBundle.js +17ms
      express:router query  : /studioBundle.js +0ms
      express:router expressInit  : /studioBundle.js +0ms
      express:router <anonymous>  : /studioBundle.js +0ms
      express:router serveStatic  : /studioBundle.js +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/studioBundle.js" +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/studioBundle.js" +1ms
      send accept ranges +0ms
      send content-type application/javascript +0ms
      express:router dispatching GET /studioBundle.f7f381c9f1337ce5688e.css +0ms
      express:router query  : /studioBundle.f7f381c9f1337ce5688e.css +0ms
      express:router expressInit  : /studioBundle.f7f381c9f1337ce5688e.css +0ms
      express:router <anonymous>  : /studioBundle.f7f381c9f1337ce5688e.css +0ms
      express:router serveStatic  : /studioBundle.f7f381c9f1337ce5688e.css +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/studioBundle.f7f381c9f1337ce5688e.css" +1ms
      express:router dispatching GET /serverBus.js +0ms
      express:router query  : /serverBus.js +0ms
      express:router expressInit  : /serverBus.js +0ms
      express:router <anonymous>  : /serverBus.js +0ms
      express:router serveStatic  : /serverBus.js +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/serverBus.js" +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/studioBundle.f7f381c9f1337ce5688e.css" +0ms
      send accept ranges +0ms
      send content-type text/css +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/serverBus.js" +1ms
      send accept ranges +0ms
      send content-type application/javascript +0ms
      express:router dispatching GET /.websocket +13ms
      express:router query  : /.websocket +0ms
      express:router expressInit  : /.websocket +0ms
      express:router <anonymous>  : /.websocket +0ms
      express:router serveStatic  : /.websocket +0ms
      send ignore dotfile "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/.websocket" +0ms
      @prisma/studio-server Client socket connection established +986ms
      engine Ready after try number 0 +1s
      photon Response: +1s
      photon { aggregateEmailSchema: { count: 1 } } +0ms
      photon Response: +2ms
      photon { aggregateMobileSchema: { count: 1 } } +0ms
      photon Response: +1ms
      photon { aggregateEmailSchema: { count: 1 } } +0ms
      photon Response: +1ms
      photon { aggregateUserAuthentication: { count: 1 } } +0ms
      photon Response: +1ms
      photon { aggregateUserAuthentication: { count: 1 } } +0ms
      photon Response: +1ms
      photon { aggregateMobileSchema: { count: 1 } } +0ms
      express:router dispatching GET /favicon/favicon-32x32.png +330ms
      express:router query  : /favicon/favicon-32x32.png +0ms
      express:router expressInit  : /favicon/favicon-32x32.png +0ms
      express:router <anonymous>  : /favicon/favicon-32x32.png +0ms
      express:router serveStatic  : /favicon/favicon-32x32.png +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/favicon/favicon-32x32.png" +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/favicon/favicon-32x32.png" +0ms
      send accept ranges +0ms
      send content-type image/png +0ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":0,\"action\":\"connect\",\"data\":{\"credentials\":{}}}}" +358ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":1,\"action\":\"request\",\"data\":{\"query\":\"photon.emailSchemas.count({\\n})\"}}}" +3ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":2,\"action\":\"request\",\"data\":{\"query\":\"photon.mobileSchemas.count({\\n})\"}}}" +0ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":3,\"action\":\"request\",\"data\":{\"query\":\"photon.userAuthentications.count({\\n})\"}}}" +6ms
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +3m
      getos { ls: '' } +0ms
      getos { platform: 'linux', libssl: '1.1.x' } +1ms
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +43ms
      getos { ls: '' } +0ms
      getos { platform: 'linux', libssl: '1.1.x' } +1ms
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +16ms
      getos { ls: '' } +0ms
      getos { platform: 'linux', libssl: '1.1.x' } +1ms
      getGenerators Resolving based on generator.output to /home/vignesh/.cache/prisma/studio/opt-timecampus-products-timecampus-server-platform-auth-src-app-db +3m
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +248ms
      getos { ls: '' } +1ms
      getos { platform: 'linux', libssl: '1.1.x' } +0ms
      cleanupCache Error: ENOENT: no such file or directory, scandir '/home/vignesh/.cache/prisma/alpha' +3m
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +9ms
      getos { ls: '' } +0ms
      getos { platform: 'linux', libssl: '1.1.x' } +1ms
      download Setting binary path for query-engine debian-openssl-1.1.x to /home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x +3m
      download Downloading https://prisma-builds.s3-eu-west-1.amazonaws.com/master/3c4da1d6caa0c40a0210a346ec982c77f74e18c7/debian-openssl-1.1.x/prisma.gz to /home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x +0ms
    Failed to generate Photon client: Error: ETXTBSY: text file is busy, open '/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x'
        at Object.openSync (fs.js:440:3)
        at Object.writeFileSync (fs.js:1281:35)
        at downloadBinary (/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/index.js:54520:22)
        at async /home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/index.js:54490:17
        at async Promise.all (index 0)
        at async Promise.all (index 0)
        at async Object.download (/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/index.js:54473:5) {
      errno: -26,
      syscall: 'open',
      code: 'ETXTBSY',
      path: '/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x'
    }
    Error starting Photon: TypeError: Cannot destructure property 'dmmf' of '(intermediate value)' as it is undefined.
        at Photon.start (/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/index.js:233515:25)
        at async connect (/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/photon-worker.js:33:13)
        at async process.<anonymous> (/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/photon-worker.js:9:18)
      express:router dispatching GET / +3s
      express:router query  : / +0ms
      express:router expressInit  : / +0ms
      express:router <anonymous>  : / +0ms
      express:router serveStatic  : / +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/server.html" +1ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/server.html" +0ms
      send accept ranges +0ms
      send content-type text/html +0ms
      express:router dispatching GET /studioBundle.f7f381c9f1337ce5688e.css +38ms
      express:router query  : /studioBundle.f7f381c9f1337ce5688e.css +0ms
      express:router expressInit  : /studioBundle.f7f381c9f1337ce5688e.css +0ms
      express:router <anonymous>  : /studioBundle.f7f381c9f1337ce5688e.css +0ms
      express:router serveStatic  : /studioBundle.f7f381c9f1337ce5688e.css +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/studioBundle.f7f381c9f1337ce5688e.css" +0ms
      express:router dispatching GET /serverBus.js +0ms
      express:router query  : /serverBus.js +0ms
      express:router expressInit  : /serverBus.js +0ms
      express:router <anonymous>  : /serverBus.js +0ms
      express:router serveStatic  : /serverBus.js +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/serverBus.js" +0ms
      express:router dispatching GET /studioBundle.js +1ms
      express:router query  : /studioBundle.js +0ms
      express:router expressInit  : /studioBundle.js +0ms
      express:router <anonymous>  : /studioBundle.js +0ms
      express:router serveStatic  : /studioBundle.js +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/studioBundle.js" +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/studioBundle.f7f381c9f1337ce5688e.css" +0ms
      send accept ranges +0ms
      send content-type text/css +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/serverBus.js" +0ms
      send accept ranges +0ms
      send content-type application/javascript +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/studioBundle.js" +0ms
      send accept ranges +1ms
      send content-type application/javascript +0ms
      express:router dispatching GET /.websocket +5ms
      express:router query  : /.websocket +0ms
      express:router expressInit  : /.websocket +0ms
      express:router <anonymous>  : /.websocket +0ms
      express:router serveStatic  : /.websocket +0ms
      send ignore dotfile "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/.websocket" +1ms
      @prisma/studio-server Client socket connection established +3s
      express:router dispatching GET /favicon/favicon-32x32.png +156ms
      express:router query  : /favicon/favicon-32x32.png +0ms
      express:router expressInit  : /favicon/favicon-32x32.png +0ms
      express:router <anonymous>  : /favicon/favicon-32x32.png +1ms
      express:router serveStatic  : /favicon/favicon-32x32.png +0ms
      send stat "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/favicon/favicon-32x32.png" +0ms
      send pipe "/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/public/favicon/favicon-32x32.png" +0ms
      send accept ranges +0ms
      send content-type image/png +0ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":0,\"action\":\"connect\",\"data\":{\"credentials\":{}}}}" +177ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":1,\"action\":\"request\",\"data\":{\"query\":\"photon.emailSchemas.count({\\n})\"}}}" +3ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":2,\"action\":\"request\",\"data\":{\"query\":\"photon.mobileSchemas.count({\\n})\"}}}" +0ms
      @prisma/studio-server Request from client: "{\"channel\":\"photon\",\"payload\":{\"requestId\":3,\"action\":\"request\",\"data\":{\"query\":\"photon.userAuthentications.count({\\n})\"}}}" +0ms
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +3s
      getos { ls: '' } +0ms
      getos { platform: 'linux', libssl: '1.1.x' } +1ms
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +50ms
      getos { ls: '' } +1ms
      getos { platform: 'linux', libssl: '1.1.x' } +0ms
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +23ms
      getos { ls: '' } +0ms
      getos { platform: 'linux', libssl: '1.1.x' } +0ms
      getGenerators Resolving based on generator.output to /home/vignesh/.cache/prisma/studio/opt-timecampus-products-timecampus-server-platform-auth-src-app-db +4s
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +260ms
      getos { ls: '' } +0ms
      getos { platform: 'linux', libssl: '1.1.x' } +1ms
      cleanupCache Error: ENOENT: no such file or directory, scandir '/home/vignesh/.cache/prisma/alpha' +4s
      getos { version: 'OpenSSL 1.1.1c  28 May 2019\n' } +14ms
      getos { ls: '' } +0ms
      getos { platform: 'linux', libssl: '1.1.x' } +0ms
      download Setting binary path for query-engine debian-openssl-1.1.x to /home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x +4s
      download Downloading https://prisma-builds.s3-eu-west-1.amazonaws.com/master/3c4da1d6caa0c40a0210a346ec982c77f74e18c7/debian-openssl-1.1.x/prisma.gz to /home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x +1ms
    Failed to generate Photon client: Error: ETXTBSY: text file is busy, open '/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x'
        at Object.openSync (fs.js:440:3)
        at Object.writeFileSync (fs.js:1281:35)
        at downloadBinary (/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/index.js:54520:22)
        at async /home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/index.js:54490:17
        at async Promise.all (index 0)
        at async Promise.all (index 0)
        at async Object.download (/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/build/index.js:54473:5) {
      errno: -26,
      syscall: 'open',
      code: 'ETXTBSY',
      path: '/home/vignesh/.nvm/versions/node/v13.0.1/lib/node_modules/prisma2/query-engine-debian-openssl-1.1.x'
    }
    
  4. pantharshit00 commented on Dec 18, 2019

    @pantharshit00
    Contributor

    Can you please try again this on alpha? It might be fixed already via #944

    Try a clean installation though. Perform npm uninstall -g prisma2 and rm -rf ~/.cache/prisma to remove prisma2 and prisma2 cache and install prisma2 via npm install -g prisma2@alpha

  5. tvvignesh commented on Dec 22, 2019

    @tvvignesh
    ContributorAuthor

    @pantharshit00 Just tried it in alpha as well but did face the same error but when doing something different. Opened up a separate issue for that here: #1209 with the reproduction steps.

  6. pantharshit00 commented on Dec 26, 2019

    @pantharshit00
    Contributor

    Closing in favour of #1209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/0-unknownkind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions