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

Docker Image won't run #729

Open
davidgs opened this issue Jan 1, 2024 · 1 comment
Open

Docker Image won't run #729

davidgs opened this issue Jan 1, 2024 · 1 comment

Comments

@davidgs
Copy link

davidgs commented Jan 1, 2024

Donwloaded the latest docker-compose.yml and tried to run it.

Linux 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

At which point:

kutt_1      |
kutt_1      | > [email protected] start /usr/src/app
kutt_1      | > npm run migrate && cross-env NODE_ENV=production node production-server/server.js
kutt_1      |
kutt_1      |
kutt_1      | > [email protected] migrate /usr/src/app
kutt_1      | > knex migrate:latest --env production
kutt_1      |
kutt_1      | Requiring external module ts-node/register
kutt_1      | Using environment: production
kutt_1      | Error: The server does not support SSL connections
kutt_1      |     at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:76:35)
kutt_1      |     at Object.onceWrapper (events.js:421:26)
kutt_1      |     at Socket.emit (events.js:314:20)
kutt_1      |     at Socket.EventEmitter.emit (domain.js:483:12)
kutt_1      |     at addChunk (_stream_readable.js:297:12)
kutt_1      |     at readableAddChunk (_stream_readable.js:272:9)
kutt_1      |     at Socket.Readable.push (_stream_readable.js:213:10)
kutt_1      |     at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
kutt_1      | npm ERR! code ELIFECYCLE
kutt_1      | npm ERR! errno 1
kutt_1      | npm ERR! [email protected] migrate: `knex migrate:latest --env production`
kutt_1      | npm ERR! Exit status 1
kutt_1      | npm ERR!
kutt_1      | npm ERR! Failed at the [email protected] migrate script.
kutt_1      | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
kutt_1      |
kutt_1      | npm ERR! A complete log of this run can be found in:
kutt_1      | npm ERR!     /root/.npm/_logs/2024-01-01T16_06_43_420Z-debug.log
kutt_1      | npm ERR! code ELIFECYCLE
kutt_1      | npm ERR! errno 1
kutt_1      | npm ERR! [email protected] start: `npm run migrate && cross-env NODE_ENV=production node production-server/server.js`
kutt_1      | npm ERR! Exit status 1
kutt_1      | npm ERR!
kutt_1      | npm ERR! Failed at the [email protected] start script.
kutt_1      | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
kutt_1      |
kutt_1      | npm ERR! A complete log of this run can be found in:
kutt_1      | npm ERR!     /root/.npm/_logs/2024-01-01T16_06_43_458Z-debug.log
kutt_kutt_1 exited with code 1

Which is the same error I get if I try to just run it locally, without Docker:

/srv/kutt # npm run start dev

> [email protected] start
> npm run migrate && cross-env NODE_ENV=production node production-server/server.js dev


> [email protected] migrate
> knex migrate:latest --env production

Requiring external module ts-node/register
Unknown file extension ".ts" for /srv/kutt/knexfile.ts
TypeError: Unknown file extension ".ts" for /srv/kutt/knexfile.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
    at defaultLoad (node:internal/modules/esm/load:143:22)
    at async ModuleLoader.load (node:internal/modules/esm/loader:409:7)
    at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:45)
    at async link (node:internal/modules/esm/module_job:76:21)

So it appears as though things are hopelessly broken.

@kengher
Copy link

kengher commented Mar 12, 2024

is your PostgreSQL server configured to accept SSL?

As for the second error, do you have the file 'tsconfig.json' in the root folder? If not, create one with:

{
	"compilerOptions": {
		"target": "es2018",
		"module": "commonjs",
		"sourceMap": true,
		"outDir": "production-server",
		"noUnusedLocals": true,
		"resolveJsonModule": true,
		"esModuleInterop": true,
		"noEmit": false,
		"emitDecoratorMetadata": true,
		"experimentalDecorators": true,
		"strict": false
	},
	"include": [
		"global.d.ts",
		"server"
	]
}

then

npm run build
npm run dev

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