Skip to content

Application is interrupted without to say anything (NodeJs 12.13.1) #830

Open

Description

@gapinto

Node Version:
12.13.1

I'm using docker:

FROM node:11-alpine

WORKDIR /management-internal-admin

COPY package.json .
COPY package-lock.json .

RUN npm install --quiet

COPY . . 

EXPOSE 9000

CMD ["npm", "start:dev"]

When I'm trying to execute this code:

       try {
            const saltValue = await genSalt(10);
            const password = await hash(createUserDto.password, saltValue);
        } catch (error) {
            console.log(error);
        }

The container is exited without saying nothing.

Log:

m-i-admin                    | [Nest] 28   - 09/09/2020, 6:27:20 AM   [NestApplication] Nest application successfully started +7ms
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.517+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"connection accepted","attr":{"remote":"172.21.0.4:59214","sessionId":65,"connectionCount":6}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.518+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn65","msg":"client metadata","attr":{"remote":"172.21.0.4:59214","client":"conn65","doc":{"driver":{"name":"nodejs|Mongoose","version":"3.6.1"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"4.15.0-112-generic"},"platform":"'Node.js v11.15.0, LE (unified)","version":"3.6.1|5.10.3"}}}
m-i-admin                    | { useNewUrlParser: true,
m-i-admin                    |   useUnifiedTopology: true,
m-i-admin                    |   useCreateIndex: true }
m-i-admin                    | mongodb://root:root@mongo:27017/development-db-pitang?authSource=admin
m-i-admin                    | mongodb://root:root@mongo:27017/development-db-pitang?authSource=admin
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.682+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"connection accepted","attr":{"remote":"172.21.0.4:59220","sessionId":66,"connectionCount":7}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.683+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn66","msg":"client metadata","attr":{"remote":"172.21.0.4:59220","client":"conn66","doc":{"driver":{"name":"nodejs|Mongoose","version":"3.6.1"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"4.15.0-112-generic"},"platform":"'Node.js v11.15.0, LE (unified)","version":"3.6.1|5.10.3"}}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.684+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"connection accepted","attr":{"remote":"172.21.0.4:59222","sessionId":67,"connectionCount":8}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.686+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn67","msg":"client metadata","attr":{"remote":"172.21.0.4:59222","client":"conn67","doc":{"driver":{"name":"nodejs|Mongoose","version":"3.6.1"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"4.15.0-112-generic"},"platform":"'Node.js v11.15.0, LE (unified)","version":"3.6.1|5.10.3"}}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.687+00:00"},"s":"I",  "c":"ACCESS",   "id":20250,   "ctx":"conn67","msg":"Successful authentication","attr":{"mechanism":"SCRAM-SHA-256","principalName":"root","authenticationDatabase":"admin","client":"172.21.0.4:59222"}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.849+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn66","msg":"connection ended","attr":{"remote":"172.21.0.4:59220","connectionCount":7}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.849+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn65","msg":"connection ended","attr":{"remote":"172.21.0.4:59214","connectionCount":5}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.850+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn64","msg":"connection ended","attr":{"remote":"172.21.0.4:59212","connectionCount":4}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.849+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn67","msg":"connection ended","attr":{"remote":"172.21.0.4:59222","connectionCount":6}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.850+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn63","msg":"Interrupted operation as its client disconnected","attr":{"opId":25930}}
mongo_1                      | {"t":{"$date":"2020-09-09T06:27:30.850+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn63","msg":"connection ended","attr":{"remote":"172.21.0.4:59210","connectionCount":3}}
m-i-admin exited with code 0

Activity

  1. sveisvei commented on Sep 24, 2020

    @sveisvei

    Same problem here - looks like the README say they do not have binaries for Alpine.

  2. powilliam commented on Oct 18, 2020

    @powilliam

    Using node:lts instead of an alpine version worked for me as @sveisvei appointed. Thanks 😄

  3. recrsn commented on Oct 20, 2020

    @recrsn
    Collaborator

    @sveisvei We do have experimental alpine binaries but it may be possible that the docker image contains glibc binaries by any chance (improper dockerignore?)

  4. nigel-daniels commented on Nov 6, 2020

    @nigel-daniels

    I'm using a docker package based on alpine:latest and see the same failure when making calls to hashSync or compare. Node version is 10.15.3. Happy to take advice on how to get any information to help resolve the defect, currently the app just crashes without giving any error message :(
    Nb. .dockerignore contains my node_modules directory. My container uses my local code directory but explicitly does not include the node_modules using the VOLUMES directive as the host OS is MacOS and the container Alpine Linux.

  5. recrsn commented on Nov 16, 2020

    @recrsn
    Collaborator

    @nigel-daniels when you performed NPM install, did it install the Alpine binary from Github?

  6. Akshay10001 commented on Nov 29, 2020

    @Akshay10001

    my problem is MODULE_NOT_FOUND , any solutions?

  7. j-catania commented on Dec 14, 2020

    @j-catania

    Hi everyone !

    alpine not working but slim seams ok.

    Thank you all,
    Juu'

  8. rivasvict commented on Jan 2, 2021

    @rivasvict

    @j-catania Thank you for this. Changing from alpine to slim totally did the job. I am still not sure how this is related to the docker image we are using. Maybe some low level failure with the scripts that help bcrypt do its job.

  9. xromp commented on Feb 1, 2021

    @xromp

    @j-catania @j-catania is this the same issue when the client side returns a cors issue after the server gets disconnected? Could I ask for the working docker file? That would be much appreciated, thanks :)

  10. despatates commented on May 10, 2024

    @despatates

    2024, and still having issues using a docker image node:20.12-alpine3.19.

    const hash = await bcrypt.hash(password, 10);
    [nodemon] app crashed - waiting for file changes before starting...
    

    Switching to image 20-slim perfectly solved the problem.

    It's not the first time I had issues with alpine images. I also encountered the same kind of problems on other projects using python and php. I'm considering no longer using alpine for my projects.

  11. nabil-hamisa commented on May 10, 2024

    @nabil-hamisa

    Problem still exist ,thanks @powilliam saved me after 3 hours of debugging

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions