semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Problem: Templates screen stuck in loading

Open wtfawk opened this issue 6 months ago • 13 comments

Issue

The templates screen was stuck in loading. Also when I opened the templates via the dashboard (direct link) and hit the edit button it got stuck.

It seems the issue was that i created a vault password (which didn't seem to work) but moved on to variable groups with a secret. When I added the VG the templates screen did not get out of the loading loop anymore.

I have deleted the vault entries from the sqlite database: delete from project__template_vault;

After this the templates screen is showing and I can edit my templates again.

Other info: Version: v2.16.32-d2c2b4a-1760089605 Sqlite database (not BoltDB)

Impact

Web-Frontend (what users interact with)

Installation method

Docker

Database

BoltDB

Browser

Chrome

Semaphore Version

v2.16.32-d2c2b4a-1760089605

Ansible Version

ansible 2.10.8

Logs & errors

Nothing was being logged. I only got a 404 in the development view of my browser.

Manual installation - system information

No response

Configuration

No response

Additional information

No response

wtfawk avatar Oct 14 '25 08:10 wtfawk

I have the same problem, when i try to see templates it loads forever, and in developer tools i found that it throws 400 Bad Request when trying to GET api/project/1/views, below are logs from container (v2.16.35, also 2.16.36) 2025-10-29T09:52:34.735640674+01:00 time="2025-10-29T08:52:34Z" level=error msg="gorp: no fields [hidden type filter sort_column sort_reverse] in type View" 2025-10-29T09:52:34.735993060+01:00 goroutine 30 [running]: 2025-10-29T09:52:34.736083007+01:00 runtime/debug.Stack() 2025-10-29T09:52:34.736092977+01:00 /usr/local/go/src/runtime/debug/stack.go:26 +0x5e 2025-10-29T09:52:34.736096934+01:00 runtime/debug.PrintStack() 2025-10-29T09:52:34.736099631+01:00 /usr/local/go/src/runtime/debug/stack.go:18 +0x13 2025-10-29T09:52:34.736102715+01:00 github.com/semaphoreui/semaphore/api/helpers.WriteError({0x2957410, 0xc0001642a0}, {0x29520e0, 0xc0003d99b0}) 2025-10-29T09:52:34.736105323+01:00 /go/src/semaphore/api/helpers/write_response.go:52 +0x192 2025-10-29T09:52:34.736108400+01:00 github.com/semaphoreui/semaphore/api/projects.GetViews({0x2957410, 0xc0001642a0}, 0xc0003dd400) 2025-10-29T09:52:34.736111018+01:00 /go/src/semaphore/api/projects/views.go:60 +0x265 2025-10-29T09:52:34.736113585+01:00 net/http.HandlerFunc.ServeHTTP(0xc000107460?, {0x2957410?, 0xc0001642a0?}, 0xc0003d9530?) 2025-10-29T09:52:34.736117519+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736120211+01:00 github.com/semaphoreui/semaphore/api.Route.GetMustCanMiddleware.func5.1({0x2957410, 0xc0001642a0}, 0xc0003dd400) 2025-10-29T09:52:34.736122796+01:00 /go/src/semaphore/api/projects/project.go:62 +0x127 2025-10-29T09:52:34.736125432+01:00 net/http.HandlerFunc.ServeHTTP(0xc0003dd180?, {0x2957410?, 0xc0001642a0?}, 0xf990a0?) 2025-10-29T09:52:34.736128067+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736130667+01:00 github.com/semaphoreui/semaphore/api/projects.ProjectMiddleware.func1({0x2957410, 0xc0001642a0}, 0xc000368000) 2025-10-29T09:52:34.736155583+01:00 /go/src/semaphore/api/projects/project.go:46 +0x41f 2025-10-29T09:52:34.736159462+01:00 net/http.HandlerFunc.ServeHTTP(0x2957410?, {0x2957410?, 0xc0001642a0?}, 0xe9b580?) 2025-10-29T09:52:34.736162125+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736164723+01:00 github.com/semaphoreui/semaphore/api.authentication.func1({0x2957410, 0xc0001642a0}, 0x1?) 2025-10-29T09:52:34.736167292+01:00 /go/src/semaphore/api/auth.go:278 +0x50 2025-10-29T09:52:34.736170012+01:00 net/http.HandlerFunc.ServeHTTP(0xf76340?, {0x2957410?, 0xc0001642a0?}, 0xc?) 2025-10-29T09:52:34.736172649+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736175234+01:00 github.com/semaphoreui/semaphore/api.JSONMiddleware.func1({0x2957410, 0xc0001642a0}, 0xc000368c80) 2025-10-29T09:52:34.736177826+01:00 /go/src/semaphore/api/router.go:57 +0xf6 2025-10-29T09:52:34.736180403+01:00 net/http.HandlerFunc.ServeHTTP(0xe8cd00?, {0x2957410?, 0xc0001642a0?}, 0x7a9b2c?) 2025-10-29T09:52:34.736182980+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736185561+01:00 github.com/semaphoreui/semaphore/api.StoreMiddleware.func1.1() 2025-10-29T09:52:34.736188196+01:00 /go/src/semaphore/api/router.go:48 +0x28 2025-10-29T09:52:34.736190784+01:00 github.com/semaphoreui/semaphore/db.StoreSession({0x296bd80, 0xc0000fabb8}, {0xc0003bae10, 0xc}, 0xc0000177c8) 2025-10-29T09:52:34.736205011+01:00 /go/src/semaphore/db/Store.go:696 +0x5f 2025-10-29T09:52:34.736208196+01:00 github.com/semaphoreui/semaphore/api.StoreMiddleware.func1({0x2957410, 0xc0001642a0}, 0xc000368c80) 2025-10-29T09:52:34.736215637+01:00 /go/src/semaphore/api/router.go:47 +0x114 2025-10-29T09:52:34.736218753+01:00 net/http.HandlerFunc.ServeHTTP(0xc000368a00?, {0x2957410?, 0xc0001642a0?}, 0xf00160?) 2025-10-29T09:52:34.736221467+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736224051+01:00 github.com/semaphoreui/semaphore/cli/cmd.runService.func1.1({0x2957410, 0xc0001642a0}, 0xc000321800?) 2025-10-29T09:52:34.736226593+01:00 /go/src/semaphore/cli/cmd/root.go:152 +0x11b 2025-10-29T09:52:34.736229179+01:00 net/http.HandlerFunc.ServeHTTP(0xc000017801?, {0x2957410?, 0xc0001642a0?}, 0x4198e5?) 2025-10-29T09:52:34.736231742+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736234553+01:00 github.com/semaphoreui/semaphore/api.Route.CORSMethodMiddleware.func2.1({0x2957410, 0xc0001642a0}, 0xc000368280) 2025-10-29T09:52:34.736237191+01:00 /go/src/semaphore/vendor/github.com/gorilla/mux/middleware.go:51 +0x87 2025-10-29T09:52:34.736239770+01:00 net/http.HandlerFunc.ServeHTTP(0xc000368000?, {0x2957410?, 0xc0001642a0?}, 0x7f4a997cb710?) 2025-10-29T09:52:34.736242404+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736245226+01:00 github.com/gorilla/mux.(*Router).ServeHTTP(0xc0000e66c0, {0x2957410, 0xc0001642a0}, 0xc000347cc0) 2025-10-29T09:52:34.736247832+01:00 /go/src/semaphore/vendor/github.com/gorilla/mux/mux.go:212 +0x1e2 2025-10-29T09:52:34.736255447+01:00 github.com/semaphoreui/semaphore/cli/cmd.runService.ProxyHeaders.func3({0x2957410, 0xc0001642a0}, 0xc000347cc0) 2025-10-29T09:52:34.736259623+01:00 /go/src/semaphore/vendor/github.com/gorilla/handlers/proxy_headers.go:59 +0x143 2025-10-29T09:52:34.736262383+01:00 net/http.HandlerFunc.ServeHTTP(0xc00003b7d4?, {0x2957410?, 0xc0001642a0?}, 0x1?) 2025-10-29T09:52:34.736264965+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736268765+01:00 github.com/semaphoreui/semaphore/cli/cmd.runService.cropTrailingSlashMiddleware.func5({0x2957410, 0xc0001642a0}, 0xc000347cc0) 2025-10-29T09:52:34.736271407+01:00 /go/src/semaphore/cli/cmd/server.go:27 +0xbd 2025-10-29T09:52:34.736274041+01:00 net/http.HandlerFunc.ServeHTTP(0x471b19?, {0x2957410?, 0xc0001642a0?}, 0xc0000acb70?) 2025-10-29T09:52:34.736276666+01:00 /usr/local/go/src/net/http/server.go:2294 +0x29 2025-10-29T09:52:34.736279293+01:00 net/http.serverHandler.ServeHTTP({0xc0003213b0?}, {0x2957410?, 0xc0001642a0?}, 0x6?) 2025-10-29T09:52:34.736281867+01:00 /usr/local/go/src/net/http/server.go:3301 +0x8e 2025-10-29T09:52:34.736284511+01:00 net/http.(*conn).serve(0xc000487320, {0x29594b8, 0xc000320060}) 2025-10-29T09:52:34.736287093+01:00 /usr/local/go/src/net/http/server.go:2102 +0x625 2025-10-29T09:52:34.736289626+01:00 created by net/http.(*Server).Serve in goroutine 1 2025-10-29T09:52:34.736292196+01:00 /usr/local/go/src/net/http/server.go:3454 +0x485

panpingusiowy avatar Oct 29 '25 09:10 panpingusiowy

FYI: Vault passwords are working fine from the fix i described in the issue itself. So its only the manualy database statement you have to execute to fix this particular issue.

wtfawk avatar Oct 29 '25 09:10 wtfawk

Deleting entries from project__template_vault nothing changed for me

panpingusiowy avatar Oct 29 '25 09:10 panpingusiowy

Same issue here. Tasks template page loading forever with same stacktrace.

welle avatar Oct 29 '25 09:10 welle

fixed by deleting couple of columns from project__view: ` PRAGMA foreign_keys = OFF;

DROP TABLE IF EXISTS temp_backup;

CREATE TABLE temp_backup ( id INTEGER, title VARCHAR(100), project_id INTEGER, position INTEGER );

INSERT INTO temp_backup (id, title, project_id, position) SELECT id, title, project_id, position FROM project__view;

DROP TABLE project__view;

CREATE TABLE project__view ( id INTEGER PRIMARY KEY AUTOINCREMENT, title VARCHAR(100) NOT NULL, project_id INTEGER NOT NULL, position INTEGER NOT NULL, CONSTRAINT FK_project__view_project FOREIGN KEY (project_id) REFERENCES project(id) ON DELETE CASCADE );

INSERT INTO project__view (id, title, project_id, position) SELECT id, title, project_id, position FROM temp_backup;

DROP TABLE temp_backup;

CREATE INDEX project__view__project__view_project_id ON project__view (project_id);

PRAGMA foreign_keys = ON; `

panpingusiowy avatar Oct 29 '25 11:10 panpingusiowy

fixed by deleting couple of columns from project__view: ` PRAGMA foreign_keys = OFF;

DROP TABLE IF EXISTS temp_backup;

CREATE TABLE temp_backup ( id INTEGER, title VARCHAR(100), project_id INTEGER, position INTEGER );

INSERT INTO temp_backup (id, title, project_id, position) SELECT id, title, project_id, position FROM project__view;

DROP TABLE project__view;

CREATE TABLE project__view ( id INTEGER PRIMARY KEY AUTOINCREMENT, title VARCHAR(100) NOT NULL, project_id INTEGER NOT NULL, position INTEGER NOT NULL, CONSTRAINT FK_project__view_project FOREIGN KEY (project_id) REFERENCES project(id) ON DELETE CASCADE );

INSERT INTO project__view (id, title, project_id, position) SELECT id, title, project_id, position FROM temp_backup;

DROP TABLE temp_backup;

CREATE INDEX project__view__project__view_project_id ON project__view (project_id);

PRAGMA foreign_keys = ON; `

Where do i run this in mySql?

SvartrShell avatar Oct 30 '25 11:10 SvartrShell

fixed by deleting couple of columns from project__view: PRAGMA foreign_keys = OFF; DROP TABLE IF EXISTS temp_backup; CREATE TABLE temp_backup ( id INTEGER, title VARCHAR(100), project_id INTEGER, position INTEGER ); INSERT INTO temp_backup (id, title, project_id, position) SELECT id, title, project_id, position FROM project__view; DROP TABLE project__view; CREATE TABLE project__view ( id INTEGER PRIMARY KEY AUTOINCREMENT, title VARCHAR(100) NOT NULL, project_id INTEGER NOT NULL, position INTEGER NOT NULL, CONSTRAINT FK_project__view_project FOREIGN KEY (project_id) REFERENCES project(id) ON DELETE CASCADE ); INSERT INTO project__view (id, title, project_id, position) SELECT id, title, project_id, position FROM temp_backup; DROP TABLE temp_backup; CREATE INDEX project__view__project__view_project_id ON project__view (project_id); PRAGMA foreign_keys = ON;

Where do i run this in mySql?

i run semaphore in docker along with a mysql docker. docker exec into your db container, login to sql db and run those commands. i just needed to replace PRAGMA with SET for mysql. dont know where PRAGMA is from ... but it worked for me.

dasfranky1 avatar Oct 30 '25 12:10 dasfranky1

Those using mysql or mariadb could try using: - alter table project__view drop hidden, drop type, drop filter, drop sort_column, drop sort_reverse;

If you are using docker compose you can access the database using: - docker compose exec semaphore-db mariadb semaphore -u semaphore -p

R0BX avatar Oct 30 '25 18:10 R0BX

alter table project__view drop hidden, drop type, drop filter, drop sort_column, drop sort_reverse;

Thanks! Can confirm this allowed me to view task templates using mariadb as the database.

wandercone avatar Oct 30 '25 23:10 wandercone

Any ideas for postgres installations?

zilonn avatar Oct 31 '25 00:10 zilonn

Any ideas for postgres installations?

For postgres you can use:

ALTER TABLE project__view
DROP COLUMN IF EXISTS hidden,
DROP COLUMN IF EXISTS type,
DROP COLUMN IF EXISTS filter,
DROP COLUMN IF EXISTS sort_column,
DROP COLUMN IF EXISTS sort_reverse;

If running in docker use:

docker exec -it <container_name> psql -U semaphore -d semaphore

Task template view is now working for me

mahrnet avatar Oct 31 '25 10:10 mahrnet

Those using mysql or mariadb could try using: - alter table project__view drop hidden, drop type, drop filter, drop sort_column, drop sort_reverse;

If you are using docker compose you can access the database using: - docker compose exec semaphore-db mariadb semaphore -u semaphore -p

Solved for me too, thanks

SvartrShell avatar Oct 31 '25 12:10 SvartrShell

Any ideas for postgres installations?

For postgres you can use:

ALTER TABLE project__view
DROP COLUMN IF EXISTS hidden,
DROP COLUMN IF EXISTS type,
DROP COLUMN IF EXISTS filter,
DROP COLUMN IF EXISTS sort_column,
DROP COLUMN IF EXISTS sort_reverse;

If running in docker use:

docker exec -it <container_name> psql -U semaphore -d semaphore

Task template view is now working for me

This worked for me! Thank you!

zilonn avatar Oct 31 '25 18:10 zilonn