pawelmalak / snippet-box

Snippet Box is a simple self-hosted app for organizing your code snippets. It allows you to easily create, edit, browse and manage your snippets in various languages.
MIT License
976 stars 80 forks source link

Build error with podman #58

Closed bhfmts closed 1 year ago

bhfmts commented 1 year ago

Hi,

I am trying to deploy snippet box with podman by doing this podman run -d --name snippetbox -p 3235:5000 -v snippet:/app/data:z -e NODE_ENV=development pawelmalak/snippet-box But I get the following error message when it is trying to build.

[2023-01-09 19:53:45.471 UTC+0] [INFO] db: Database connected [2023-01-09 19:53:45.482 UTC+0] [INFO] db: Found pending migrations. Executing... [2023-01-09 19:53:45.483 UTC+0] [DEV] db: Executing 00_initial.js migration [2023-01-09 19:53:45.483 UTC+0] [DEV] db: Executing 01_pinned_snippets.js migration [2023-01-09 19:53:45.483 UTC+0] [DEV] db: Executing 02_tags.js migration [2023-01-09 19:53:45.503 UTC+0] [ERROR] db: Database connection error DatabaseError [SequelizeDatabaseError]: SQLITE_ERROR: duplicate column name: isPinned at Query.formatError (/app/node_modules/sequelize/lib/dialects/sqlite/query.js:403:16) at Query._handleQueryResponse (/app/node_modules/sequelize/lib/dialects/sqlite/query.js:72:18) at afterExecute (/app/node_modules/sequelize/lib/dialects/sqlite/query.js:238:27) at Statement.errBack (/app/node_modules/sqlite3/lib/sqlite3.js:14:21) From previous event: at /app/node_modules/umzug/lib/index.js:116:62 at processImmediate (internal/timers.js:464:21) From previous event: at /app/node_modules/umzug/lib/index.js:112:43 From previous event: at Umzug.execute (/app/node_modules/umzug/lib/index.js:112:9) at Umzug._run (/app/node_modules/umzug/lib/index.js:279:19) at Umzug.<anonymous> (/app/node_modules/umzug/lib/index.js:307:21) From previous event: at Umzug._run (/app/node_modules/umzug/lib/index.js:306:10) at Umzug.up (/app/node_modules/umzug/lib/index.js:198:17) at /app/build/db/index.js:54:21 at Generator.next (<anonymous>) at fulfilled (/app/build/db/index.js:5:58) { parent: [Error: SQLITE_ERROR: duplicate column name: isPinned] { errno: 1, code: 'SQLITE_ERROR', sql: 'ALTER TABLEsnippetsADDisPinnedINTEGER DEFAULT 0;' }, original: [Error: SQLITE_ERROR: duplicate column name: isPinned] { errno: 1, code: 'SQLITE_ERROR', sql: 'ALTER TABLEsnippetsADDisPinnedINTEGER DEFAULT 0;' }, sql: 'ALTER TABLEsnippetsADDisPinnedINTEGER DEFAULT 0;', parameters: undefined }

HorusPi commented 1 year ago

maybe it is the part "-v snippet:/app/data:z"

At least in my machine with docker I have to put the full path to map the location of the database like this

"-v E:/VM/snippet-box/data:/app/data"

Not sure if this is the case , but I would expect podman to abide by the same rules.

bhfmts commented 1 year ago

Yeah! Actually that how I solved :) Thanks!