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

Knex Migrate MSSQL error #6048

Open
ping-samantham opened this issue Mar 27, 2024 · 1 comment
Open

Knex Migrate MSSQL error #6048

ping-samantham opened this issue Mar 27, 2024 · 1 comment

Comments

@ping-samantham
Copy link

Environment

Knex version: 3.1.0
Database + version: MSSQL @smorey2
OS: Linux via Docker

Bug

  1. Explain what kind of behaviour you are getting and how you think it should do
    I'm trying to set up migrations for my sql database. When docker runs knex migrate:latest, I'm getting an error with the connectionSettings property where it is undefined.

  2. Error message
    image

  3. Reduced test code, for example in https://npm.runkit.com/knex or if it needs real
    database connection to MySQL or PostgreSQL, then single file example which initializes
    needed data and demonstrates the problem.
    Logged connection settings from knexfile-
    {
    port: 1433,
    host: 'host.docker.internal',
    user: 'xxx',
    password: 'xxxx',
    database: 'xxx',
    options: { useUTC: true }
    }
    image

I went to the line in the stack trace, /app/node_modules/knex/lib/dialects/mssql/index.js:342:31, and found this.
image

When I console logged this.connectionSettings is undefined. I added some more logs and changed it to a path where connectionSettings is not undefined, and then it works. (I don't think this is the solution just trying to see if what I have for my connection string would be working).
image

@DanielFigueiredoPuah
Copy link

I have a same problem

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

2 participants