Coder Social home page Coder Social logo

Comments (5)

tobske avatar tobske commented on August 17, 2024 12

I don't use the npm part of the setup and only execute sqlserver and import-data.sh in the entrypoint.sh. If I kept the order of those two the same in the entrypoint.sh my container is stopping at the end, too. If I switch those two the container stays up. The reason is that because of the & the first command is executed in the in a subshell which means that the outer shell does not wait for this command to finish so it only waits for the second command. If this second command is the import-data.sh which ends after sometime the whole shell and so the whole container will finish. It the order is switched the outer shell is waiting for the sqlserver to end and as this command does not end normally the container stays open.

There is some explanation for this here: https://www.gnu.org/software/bash/manual/bash.html#Lists

Maybe this helps someone with a similar issue.

from mssql-node-docker-demo-app.

aplanting avatar aplanting commented on August 17, 2024

the problem is with the bulk load of the file. Inspect the logs with docker logs <container_id>

Starting copy... SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC Driver 13 for SQL Server]Unexpected EOF encountered in BCP data-file
then the container stops. the scripts starts after 90 seconds.

I have converted the file endings to because i run on Linux to LF and the error goes away but still the container exits.

the BCP is causing the problem I guess

** update **
When removing the import-data.sh script completely the container stays up. BCP is not the problem because setup.sql also causes the container to stop.

from mssql-node-docker-demo-app.

twright-msft avatar twright-msft commented on August 17, 2024

Yes, exactly @tobske . We've recently updated the documentation to provide this tip as well. https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-configure-docker?view=sql-server-linux-2017#customcontainer
@rdalfonso abd @aplanting - can you confirm that changing the order of the commands resolves the issue for you?

from mssql-node-docker-demo-app.

MarlomSouza avatar MarlomSouza commented on August 17, 2024

@twright-msft , I can confirm that if you change the order the container will continue running. There is an exemple in my github.
https://github.com/MarlomSouza/database_docker

from mssql-node-docker-demo-app.

twright-msft avatar twright-msft commented on August 17, 2024

Thanks for sharing @MarlomSouza . I'm going to go ahead and close out this issue. @rdalfonso or @aplanting - if this is still an issue after trying the above recommendations, please reactivate.

from mssql-node-docker-demo-app.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.