Can't create a new project

Hello,

I can’t anymore create a new project

error message:
Unable to create your project.

data/debug.log

[    2019-07-22 22:27:57] [debug] Kanboard\Core\Controller\BaseMiddleware::next => Kanboard\Middleware\PostAuthenticationMiddleware
    [2019-07-22 22:27:57] [debug] Kanboard\Core\Controller\BaseMiddleware::next => Kanboard\Middleware\ApplicationAuthorizationMiddleware
    [2019-07-22 22:27:57] [debug] Kanboard\Core\Controller\BaseMiddleware::next => Kanboard\Middleware\ProjectAuthorizationMiddleware
    [2019-07-22 22:27:57] [debug] Kanboard\Core\Controller\Runner::executeController => \Kanboard\Controller\ProjectCreationController::create
    [2019-07-22 22:27:57] [debug] SQL: SELECT "data" FROM "sessions"   WHERE "id" = ?    LIMIT 1
    [2019-07-22 22:27:57] [debug] SQL: query_duration=0.00064682960510254
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.00064682960510254
    [2019-07-22 22:27:57] [debug] SQL: SELECT "option", "value" FROM "settings"
    [2019-07-22 22:27:57] [debug] SQL: query_duration=2.3126602172852E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.00066995620727539
    [2019-07-22 22:27:57] [debug] SQL: SELECT projects.id, projects.name FROM "projects" LEFT JOIN "project_has_users" ON "project_has_users"."project_id"="projects"."id"  WHERE project_has_users.user_id = ? AND projects.is_active IN (?)
    [2019-07-22 22:27:57] [debug] SQL: query_duration=4.8160552978516E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.00071811676025391
    [2019-07-22 22:27:57] [debug] SQL: SELECT projects.id, projects.name FROM "projects" LEFT JOIN "project_has_groups" ON "project_has_groups"."project_id"="projects"."id" LEFT JOIN "group_has_users" ON "group_has_users"."group_id"="project_has_groups"."group_id"  WHERE group_has_users.user_id = ? AND projects.is_active IN (?)
    [2019-07-22 22:27:57] [debug] SQL: query_duration=4.57763671875E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.00076389312744141
    [2019-07-22 22:27:57] [debug] SQL: SELECT * FROM "actions"   WHERE "project_id" IN (?, ?)
    [2019-07-22 22:27:57] [debug] SQL: query_duration=2.8848648071289E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.0007927417755127
    [2019-07-22 22:27:57] [debug] SQL: SELECT * FROM "action_has_params"   WHERE "action_id" IN (?, ?)
    [2019-07-22 22:27:57] [debug] SQL: query_duration=3.2186508178711E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.00082492828369141
    [2019-07-22 22:27:57] [debug] SQL: SELECT 1 FROM "users"  WHERE "id" = ? AND "is_active" = ? AND "role" = ?
    [2019-07-22 22:27:57] [debug] SQL: query_duration=2.9087066650391E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.0008540153503418
    [2019-07-22 22:27:57] [debug] SQL: SELECT projects.id, projects.name FROM "projects" LEFT JOIN "project_has_users" ON "project_has_users"."project_id"="projects"."id"  WHERE project_has_users.user_id = ? AND projects.is_active IN (?)
    [2019-07-22 22:27:57] [debug] SQL: query_duration=4.0054321289062E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.00089406967163086
    [2019-07-22 22:27:57] [debug] SQL: SELECT projects.id, projects.name FROM "projects" LEFT JOIN "project_has_groups" ON "project_has_groups"."project_id"="projects"."id" LEFT JOIN "group_has_users" ON "group_has_users"."group_id"="project_has_groups"."group_id"  WHERE group_has_users.user_id = ? AND projects.is_active IN (?)
    [2019-07-22 22:27:57] [debug] SQL: query_duration=3.814697265625E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.00093221664428711
    [2019-07-22 22:27:57] [debug] SQL: SELECT 1 FROM "sessions"  WHERE "id" = ?
    [2019-07-22 22:27:57] [debug] SQL: query_duration=3.2901763916016E-5
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.00096511840820312
    [2019-07-22 22:27:57] [debug] SQL: UPDATE "sessions" SET "expire_at"=?, "data"=?  WHERE "id" = ?
    [2019-07-22 22:27:57] [debug] SQL: query_duration=0.00011610984802246
    [2019-07-22 22:27:57] [debug] SQL: total_execution_time=0.0010812282562256
    [2019-07-22 22:27:57] [debug] APP: nb_queries=11
    [2019-07-22 22:27:57] [debug] APP: rendering_time=0.23212289810181
    [2019-07-22 22:27:57] [debug] APP: memory_usage=8.72M
    [2019-07-22 22:27:57] [debug] APP: uri=/?controller=ProjectCreationController&action=create
    [2019-07-22 22:27:57] [debug] ###############################################
    [2019-07-23 00:28:01] [debug] Kanboard\Core\Controller\Runner::executeMiddleware
    [2019-07-23 00:28:01] [debug] Subscriber executed: Kanboard\Subscriber\BootstrapSubscriber::execute
    [2019-07-22 22:28:01] [debug] Kanboard\Core\Controller\BaseMiddleware::next => Kanboard\Middleware\AuthenticationMiddleware
    [2019-07-22 22:28:01] [debug] Kanboard\Core\Controller\BaseMiddleware::next => Kanboard\Middleware\PostAuthenticationMiddleware
    [2019-07-22 22:28:01] [debug] Kanboard\Core\Controller\BaseMiddleware::next => Kanboard\Middleware\ApplicationAuthorizationMiddleware
    [2019-07-22 22:28:01] [debug] Kanboard\Core\Controller\BaseMiddleware::next => Kanboard\Middleware\ProjectAuthorizationMiddleware
    [2019-07-22 22:28:01] [debug] Kanboard\Core\Controller\Runner::executeController => \Kanboard\Controller\ProjectCreationController::save
    [2019-07-22 22:28:01] [debug] SQL: SELECT "data" FROM "sessions"   WHERE "id" = ?    LIMIT 1
    [2019-07-22 22:28:01] [debug] SQL: query_duration=0.00064206123352051
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00064206123352051
    [2019-07-22 22:28:01] [debug] SQL: SELECT "option", "value" FROM "settings"
    [2019-07-22 22:28:01] [debug] SQL: query_duration=2.3126602172852E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00066518783569336
    [2019-07-22 22:28:01] [debug] SQL: SELECT projects.id, projects.name FROM "projects" LEFT JOIN "project_has_users" ON "project_has_users"."project_id"="projects"."id"  WHERE project_has_users.user_id = ? AND projects.is_active IN (?)
    [2019-07-22 22:28:01] [debug] SQL: query_duration=4.887580871582E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00071406364440918
    [2019-07-22 22:28:01] [debug] SQL: SELECT projects.id, projects.name FROM "projects" LEFT JOIN "project_has_groups" ON "project_has_groups"."project_id"="projects"."id" LEFT JOIN "group_has_users" ON "group_has_users"."group_id"="project_has_groups"."group_id"  WHERE group_has_users.user_id = ? AND projects.is_active IN (?)
    [2019-07-22 22:28:01] [debug] SQL: query_duration=4.6014785766602E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00076007843017578
    [2019-07-22 22:28:01] [debug] SQL: SELECT * FROM "actions"   WHERE "project_id" IN (?, ?)
    [2019-07-22 22:28:01] [debug] SQL: query_duration=2.9087066650391E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00078916549682617
    [2019-07-22 22:28:01] [debug] SQL: SELECT * FROM "action_has_params"   WHERE "action_id" IN (?, ?)
    [2019-07-22 22:28:01] [debug] SQL: query_duration=3.1948089599609E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00082111358642578
    [2019-07-22 22:28:01] [debug] SQL: SELECT 1 FROM "users"  WHERE "id" = ? AND "is_active" = ? AND "role" = ?
    [2019-07-22 22:28:01] [debug] SQL: query_duration=2.9087066650391E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00085020065307617
    [2019-07-22 22:28:01] [debug] SQL: SELECT 1 FROM "users"  WHERE "id" = ?
    [2019-07-22 22:28:01] [debug] SQL: query_duration=2.3126602172852E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00087332725524902
    [2019-07-22 22:28:01] [debug] SQL: INSERT INTO "projects" ("name", "is_private", "identifier", "token", "last_modified", "owner_id") VALUES (:name, :is_private, :identifier, :token, :last_modified, :owner_id)
    [2019-07-22 22:28:01] [debug] SQL: query_duration=7.3909759521484E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00094723701477051
    [2019-07-22 22:28:01] [debug] SQL: INSERT INTO "columns" ("title", "position", "project_id", "task_limit", "description", "hide_in_dashboard") VALUES (:title, :position, :project_id, :task_limit, :description, :hide_in_dashboard)
    [2019-07-22 22:28:01] [debug] SQL: SQLSTATE[23000]: Integrity constraint violation: 19 columns title, project_id are not unique
    [2019-07-22 22:28:01] [debug] SQL: SELECT projects.id, projects.name FROM "projects" LEFT JOIN "project_has_users" ON "project_has_users"."project_id"="projects"."id"  WHERE project_has_users.user_id = ? AND projects.is_active IN (?)
    [2019-07-22 22:28:01] [debug] SQL: query_duration=4.1007995605469E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.00098824501037598
    [2019-07-22 22:28:01] [debug] SQL: SELECT projects.id, projects.name FROM "projects" LEFT JOIN "project_has_groups" ON "project_has_groups"."project_id"="projects"."id" LEFT JOIN "group_has_users" ON "group_has_users"."group_id"="project_has_groups"."group_id"  WHERE group_has_users.user_id = ? AND projects.is_active IN (?)
    [2019-07-22 22:28:01] [debug] SQL: query_duration=3.9100646972656E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.0010273456573486
    [2019-07-22 22:28:01] [debug] SQL: SELECT 1 FROM "sessions"  WHERE "id" = ?
    [2019-07-22 22:28:01] [debug] SQL: query_duration=3.4093856811523E-5
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.0010614395141602
    [2019-07-22 22:28:01] [debug] SQL: UPDATE "sessions" SET "expire_at"=?, "data"=?  WHERE "id" = ?
    [2019-07-22 22:28:01] [debug] SQL: query_duration=0.00010013580322266
    [2019-07-22 22:28:01] [debug] SQL: total_execution_time=0.0011615753173828
    [2019-07-22 22:28:01] [debug] APP: nb_queries=13
    [2019-07-22 22:28:01] [debug] APP: rendering_time=0.1627631187439
    [2019-07-22 22:28:01] [debug] APP: memory_usage=8.83M
    [2019-07-22 22:28:01] [debug] APP: uri=/?controller=ProjectCreationController&action=save
    [2019-07-22 22:28:01] [debug] ###############################################
  • OS version: Linux 4.8.11
  • Database version: SQlite 3.4.1
  • PHP-Version: 7.1.1

greetings perry

KB version?

You say, “anymore”, was there something you did recently that caused the issue to occur?

The issue:

Previous reports:

Anything you can provide to help duplicate the issue would help.

Kanboard Version 1.2.10

Installed theMarkDown+ Plugin
and
/config.php set the debug mode = false

maybe something is wrong into the .htaccess ?

# Pass HTTP Authorization header via environment variable to PHP backend
# to make HTTP Basic Authentication work for Apache/FastCGI/php-fpm
# setups (required to authenticate over the API)
<IfModule mod_setenvif.c>
    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>

<IfModule mod_rewrite.c>
    #Options -MultiViews


    <IfModule mod_env.c>
        SetEnv HTTP_MOD_REWRITE On
    </IfModule>
    

    # Uncomment this line depending of your Apache configuration
    # RewriteBase /

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
    
    ############################
    ## Uncomment the two lines below to enable force HTTPS capabilities
    ############################
    
    RewriteCond %{HTTPS} !=on 
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>

<IfModule pagespeed_module>
    ModPagespeed Off
</IfModule>

If I want to create a private project, the message appears:

There is no user management for private projects.

I’ve managed to reproduce this issue by setting two columns with exact same name on Settings > Project Settings > Default columns for new projects (Comma-separated)

Please check that config and make sure you don’t have duplicate names there.

The message that appears on private projects creation is correct. If you create a private project, is a project only you can see, so you will not be able to manage users and permitions unless you change it to not private. See here for more info

I deleted the contents of the field and tried again, unfortunately the same error message.

There is also another problem the project management page is not displayed correctly and an error message appears:
Internal Error: SQL Error: SQLSTATE[HY000]: General error: 1 ambiguous column name: name

Do you have any plugins installed?
Does this issues always happened? Started happening after an upgrade, or after install a plugin?

Do you have any plugins installed?
No not more.
Does this issues always happened?
yes
Started happening after an upgrade, or after install a plugin?
I don’t know because I started to work with kanboard
1 test project
1 real project
and now I tried to add the next project but…

console output:
1 Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=block: expected semicolon at character position 13. The default protections will be applied.

I tried a new installation and created any projects no problem!
Is the SQlite DB broken ? How to repair the db ?

That was just what I would ask you next.
Can you share your SQLite file?
You can make a copy of the file data/db.sqlite somewhere else (make sure you have a copy!) delete the tasks or any sensitive data you want to delete, check if the issue still happens after you delete your stuff and then share this file. Then you just rename the SQLite copy you made back to data/db.sqlite and you won’t loose anything.
I could check your database file to see if I find anything broken and then tell you how to fix yours.

I deleted all projects and tried to create a new one without success.

How to share the SQlite file ?

If you are having difficulty navigating your server:

click the “Download the database” link and send that file to him:
image

How to download the SQlite db I know, but how to upload a zip here ? PM a not available.

Ask him for his email address…:wink:

Or learn to github, you can find anyone’s email address in commits.

I will have a look now. You can remove the file from your google drive now if you wish, and/or remove the link from your comment!

First, I recommend you go to your kanboard settings > API and reset the api token so the one in the file you just shared is no longer valid on your site

1 Like

Did you do anything directly to your sqlite file? It has no projects but it has columns, swimlanes, even tasks, and this shouldn’t happen if you remove a project using the interface.

sqlite> select distinct project_id from tasks;
1
2
3
sqlite> select distinct project_id from columns;
1
2
3
4
sqlite> select distinct project_id from swimlanes;
1
2
3
4
sqlite> select * from projects;
sqlite> 

I see that there should be at least 4 projects. So I inserted them manually:

insert into projects (id, name) values (1, 'project 1'), (2, 'project 2'), (3, 'project 3'), (4, 'project 4');

Run this insert in your sqlite file and you should be able to see those old projects on kanboard, delete them if you don’t need it anymore and also create a new one afterwards. However, I also noticed a very strange error while trying to delete a user:

[2019-07-25 03:20:34] [debug] SQL: DELETE FROM "users"  WHERE "id" = ?
[2019-07-25 03:20:34] [debug] SQL: SQLSTATE[HY000]: General error: 1 no such table: main.task_has_subtasks

Looking at kanboard history, this table task_has_subtasks was renamed to subtasks 5 years ago! Again, it was an error with your database, your table subtask_time_tracking was still referencing the old table:

sqlite> .dump subtask_time_tracking
...
CREATE TABLE subtask_time_tracking (
...
            FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE
...

this is possible to solve too. Run the following commands on your sqlite database:

alter table subtasks rename to task_has_subtasks;
PRAGMA FOREIGN_KEYS = ON;
alter table task_has_subtasks rename to subtasks;

now the reference is fixed:

sqlite> .dump subtask_time_tracking
...
CREATE TABLE subtask_time_tracking (
...
            FOREIGN KEY(subtask_id) REFERENCES "subtasks"(id) ON DELETE CASCADE
...
sqlite> 

Well… in conclusion:

If I were you I wouldn’t trust your database file anymore. You can do what I said here to recover it and get the tasks back, but I would start over with a blank database file.
Do you have any idea what may have happened to cause this errors on it? Have you been using this database across versions for a long time?

Thank you for your help!

I used the db only ± 1 week.
I will reinstall Kanboard, is there any way to export all projects including comments and then import them?

Kanboard has an export tasks feature and an import csv feature, but I’ve never used those and I’ve seen people reporting the export format is incompatible with the import format. Anyway, I don’t think either will handle comments.
You can try to export the csv and then change it to match the expected csv format to import. On the import tasks screen you can download an example csv file.
If you are going to install a new kanboard instance, I highly recommend you to use a database server, MySQL/mariadb or PostgreSQL. It’s really more reliable than SQLite.