A mysterious label <nil> is shown after upgrading #1713

Closed
opened 2025-11-02 04:10:41 -06:00 by GiteaMirror · 15 comments
Owner

Originally created by @typeless on GitHub (Apr 20, 2018).

  • Gitea version (or commit ref):
    Gitea Version: 1.1.0+1156-g725835b

  • Git version:
    git version 2.7.4

  • Operating system:
    Ubuntu 16.04.3 LTS

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • [x ] SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

'' is shown at some places including the input field of login name.
I built my Gitea instance from git-cloned source with TAGS="bindata sqlite" make generate all
It has been worked well for quite a while until I decided to upgrade it today. The app.ini has been upgraded per the new sample too.
...

Screenshots

image
image

Originally created by @typeless on GitHub (Apr 20, 2018). - Gitea version (or commit ref): Gitea Version: 1.1.0+1156-g725835b - Git version: git version 2.7.4 - Operating system: Ubuntu 16.04.3 LTS - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description '<nil>' is shown at some places including the input field of login name. I built my Gitea instance from git-cloned source with `TAGS="bindata sqlite" make generate all` It has been worked well for quite a while until I decided to upgrade it today. The app.ini has been upgraded per the new sample too. ... ## Screenshots ![image](https://user-images.githubusercontent.com/2606021/39046935-9b978d64-44ca-11e8-86e1-5da59cd96d5e.png) ![image](https://user-images.githubusercontent.com/2606021/39047258-d96c78d8-44cb-11e8-9a95-2d735c415f1c.png) <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@lafriks commented on GitHub (Apr 20, 2018):

Do you see any errors in gitea.log?

@lafriks commented on GitHub (Apr 20, 2018): Do you see any errors in gitea.log?
Author
Owner

@typeless commented on GitHub (Apr 23, 2018):

@lafriks No. I cannot find anything suspicious. I can reproduce this even with a flesh Gitea instance, which doesn't generate any error in the log.

Edit: Are there any dependencies other than code.gitea.io/gitea? I suppose all dependencies are self-contained in the code.gitea.io/gitea/vendor. Or do I need to regenerate anything before make generate build?

Edit2: Yet another question. Can you point out for me how value="{{.user_name}}" in the template is connected to the actual data? Grepping 'user_name' for all Go code doesn't give anything indicative.

@typeless commented on GitHub (Apr 23, 2018): @lafriks No. I cannot find anything suspicious. I can reproduce this even with a flesh Gitea instance, which doesn't generate any error in the log. Edit: Are there any dependencies other than code.gitea.io/gitea? I suppose all dependencies are self-contained in the code.gitea.io/gitea/vendor. Or do I need to regenerate anything before `make generate build`? Edit2: Yet another question. Can you point out for me how `value="{{.user_name}}"` in the template is connected to the actual data? Grepping 'user_name' for all Go code doesn't give anything indicative.
Author
Owner

@techknowlogick commented on GitHub (Jun 27, 2018):

@typeless does this still happen?

@techknowlogick commented on GitHub (Jun 27, 2018): @typeless does this still happen?
Author
Owner

@typeless commented on GitHub (Jun 28, 2018):

The problem at the sign-in page does not happen anymore. But it remains at the issues page.

image

@typeless commented on GitHub (Jun 28, 2018): The problem at the sign-in page does not happen anymore. But it remains at the issues page. ![image](https://user-images.githubusercontent.com/2606021/42008455-35b3d718-7ab8-11e8-95ed-d7c9b0c46733.png)
Author
Owner

@techknowlogick commented on GitHub (Jun 28, 2018):

Are you able to list all the rows in the topic table? I'm wondering if it is stored as a nil value in the DB, or if it is stored as a string as "<nil>"

As you are using sqlite the GUI tool I like is https://sqlitebrowser.org/

@techknowlogick commented on GitHub (Jun 28, 2018): Are you able to list all the rows in the `topic` table? I'm wondering if it is stored as a nil value in the DB, or if it is stored as a string as "\<nil\>" As you are using sqlite the GUI tool I like is https://sqlitebrowser.org/
Author
Owner

@typeless commented on GitHub (Jun 28, 2018):

The tab topic has no rows. (select * from topic; from the sqlite3 command-line). The table does exist though.

@typeless commented on GitHub (Jun 28, 2018): The tab `topic` has no rows. (`select * from topic;` from the sqlite3 command-line). The table does exist though.
Author
Owner

@techknowlogick commented on GitHub (Jun 28, 2018):

That's very interesting. I wonder if there is something wrong with a sql join then. Can you look at the repo_topic table?

@techknowlogick commented on GitHub (Jun 28, 2018): That's very interesting. I wonder if there is something wrong with a sql join then. Can you look at the `repo_topic` table?
Author
Owner

@typeless commented on GitHub (Jun 28, 2018):

Same. The table has no row.

@typeless commented on GitHub (Jun 28, 2018): Same. The table has no row.
Author
Owner

@techknowlogick commented on GitHub (Jun 28, 2018):

Ah. I wasn't looking at this ticket correctly. I have been dealing with topic issues so much lately, and so I confused label and topic. I'm so sorry. Can you look at the label and repo_label table instead?

@techknowlogick commented on GitHub (Jun 28, 2018): Ah. I wasn't looking at this ticket correctly. I have been dealing with `topic` issues so much lately, and so I confused `label` and `topic`. I'm so sorry. Can you look at the `label` and `repo_label` table instead?
Author
Owner

@typeless commented on GitHub (Jun 28, 2018):

sqlite> select * from label;
1|9|bug|#ee0701|4|0|
2|9|duplicate|#cccccc|0|0|
3|9|enhancement|#84b6eb|4|0|
4|9|help wanted|#128a0c|0|0|
5|9|invalid|#e6e6e6|0|0|
6|9|question|#cc317c|0|0|
7|9|wontfix|#ffffff|0|0|
8|9|priority-low|#207de5|3|0|
9|9|build-tools|#fbca04|3|0|
10|122|bug|#ee0701|3|1|
11|122|duplicate|#cccccc|0|0|
12|122|enhancement|#84b6eb|2|0|
13|122|help wanted|#128a0c|0|0|
14|122|invalid|#e6e6e6|0|0|
15|122|question|#cc317c|0|0|
16|122|wontfix|#ffffff|0|0|
17|127|bug|#ee0701|0|0|
18|127|duplicate|#cccccc|0|0|
19|127|enhancement|#84b6eb|0|0|
20|127|help wanted|#128a0c|0|0|
21|127|invalid|#e6e6e6|0|0|
22|127|question|#cc317c|0|0|
23|127|wontfix|#ffffff|0|0|

And there is no such table named repo_label.

sqlite> .table
access               label                repository
access_token         lfs_lock             star
action               lfs_meta_object      stopwatch
attachment           login_source         team
collaboration        milestone            team_repo
comment              mirror               team_user
commit_status        notice               topic
deleted_branch       notification         tracked_time
deploy_key           oauth2_session       two_factor
email_address        org_user             u2_f_registration
external_login_user  protected_branch     u2f_registration
follow               public_key           update_task
gpg_key              pull_request         upload
hook_task            reaction             user
issue                release              user_open_id
issue_assignees      repo_indexer_status  version
issue_label          repo_redirect        watch
issue_user           repo_topic           webhook
issue_watch          repo_unit
sqlite>

Edit: this is issue_label.

sqlite> select * from issue_label;
3|7|3
4|6|1
5|8|3
6|9|3
7|10|1
8|11|3
9|12|1
10|13|1
11|9|8
12|8|8
13|7|8
14|10|9
15|9|9
16|8|9
17|30|12
18|29|12
19|31|10
20|32|10
21|33|10
@typeless commented on GitHub (Jun 28, 2018): ``` sqlite> select * from label; 1|9|bug|#ee0701|4|0| 2|9|duplicate|#cccccc|0|0| 3|9|enhancement|#84b6eb|4|0| 4|9|help wanted|#128a0c|0|0| 5|9|invalid|#e6e6e6|0|0| 6|9|question|#cc317c|0|0| 7|9|wontfix|#ffffff|0|0| 8|9|priority-low|#207de5|3|0| 9|9|build-tools|#fbca04|3|0| 10|122|bug|#ee0701|3|1| 11|122|duplicate|#cccccc|0|0| 12|122|enhancement|#84b6eb|2|0| 13|122|help wanted|#128a0c|0|0| 14|122|invalid|#e6e6e6|0|0| 15|122|question|#cc317c|0|0| 16|122|wontfix|#ffffff|0|0| 17|127|bug|#ee0701|0|0| 18|127|duplicate|#cccccc|0|0| 19|127|enhancement|#84b6eb|0|0| 20|127|help wanted|#128a0c|0|0| 21|127|invalid|#e6e6e6|0|0| 22|127|question|#cc317c|0|0| 23|127|wontfix|#ffffff|0|0| ``` And there is no such table named `repo_label`. ``` sqlite> .table access label repository access_token lfs_lock star action lfs_meta_object stopwatch attachment login_source team collaboration milestone team_repo comment mirror team_user commit_status notice topic deleted_branch notification tracked_time deploy_key oauth2_session two_factor email_address org_user u2_f_registration external_login_user protected_branch u2f_registration follow public_key update_task gpg_key pull_request upload hook_task reaction user issue release user_open_id issue_assignees repo_indexer_status version issue_label repo_redirect watch issue_user repo_topic webhook issue_watch repo_unit sqlite> ``` Edit: this is `issue_label`. ``` sqlite> select * from issue_label; 3|7|3 4|6|1 5|8|3 6|9|3 7|10|1 8|11|3 9|12|1 10|13|1 11|9|8 12|8|8 13|7|8 14|10|9 15|9|9 16|8|9 17|30|12 18|29|12 19|31|10 20|32|10 21|33|10 ```
Author
Owner

@techknowlogick commented on GitHub (Jun 28, 2018):

I think I need to go to sleep, I actually meant issue_label instead of repo_label. Again, I'm so sorry for getting that wrong.

@techknowlogick commented on GitHub (Jun 28, 2018): I think I need to go to sleep, I actually meant `issue_label` instead of `repo_label`. Again, I'm so sorry for getting that wrong.
Author
Owner

@typeless commented on GitHub (Jun 28, 2018):

No problem. 😄

@typeless commented on GitHub (Jun 28, 2018): No problem. 😄
Author
Owner

@techknowlogick commented on GitHub (Jun 28, 2018):

@typeless after a good night rest, I'm clear headed now. Are you able to provide a dump of the issue_label table?

@techknowlogick commented on GitHub (Jun 28, 2018): @typeless after a good night rest, I'm clear headed now. Are you able to provide a dump of the `issue_label` table?
Author
Owner

@typeless commented on GitHub (Jun 29, 2018):

sqlite> .dump 'issue_label'
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE `issue_label` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `issue_id` INTEGER NULL, `label_id` INTEGER NULL);
INSERT INTO "issue_label" VALUES(3,7,3);
INSERT INTO "issue_label" VALUES(4,6,1);
INSERT INTO "issue_label" VALUES(5,8,3);
INSERT INTO "issue_label" VALUES(6,9,3);
INSERT INTO "issue_label" VALUES(7,10,1);
INSERT INTO "issue_label" VALUES(8,11,3);
INSERT INTO "issue_label" VALUES(9,12,1);
INSERT INTO "issue_label" VALUES(10,13,1);
INSERT INTO "issue_label" VALUES(11,9,8);
INSERT INTO "issue_label" VALUES(12,8,8);
INSERT INTO "issue_label" VALUES(13,7,8);
INSERT INTO "issue_label" VALUES(14,10,9);
INSERT INTO "issue_label" VALUES(15,9,9);
INSERT INTO "issue_label" VALUES(16,8,9);
INSERT INTO "issue_label" VALUES(17,30,12);
INSERT INTO "issue_label" VALUES(18,29,12);
INSERT INTO "issue_label" VALUES(19,31,10);
INSERT INTO "issue_label" VALUES(20,32,10);
INSERT INTO "issue_label" VALUES(21,33,10);
CREATE UNIQUE INDEX `UQE_issue_label_S` ON `issue_label` (`issue_id`,`label_id`);
COMMIT;
@typeless commented on GitHub (Jun 29, 2018): ``` sqlite> .dump 'issue_label' PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE `issue_label` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `issue_id` INTEGER NULL, `label_id` INTEGER NULL); INSERT INTO "issue_label" VALUES(3,7,3); INSERT INTO "issue_label" VALUES(4,6,1); INSERT INTO "issue_label" VALUES(5,8,3); INSERT INTO "issue_label" VALUES(6,9,3); INSERT INTO "issue_label" VALUES(7,10,1); INSERT INTO "issue_label" VALUES(8,11,3); INSERT INTO "issue_label" VALUES(9,12,1); INSERT INTO "issue_label" VALUES(10,13,1); INSERT INTO "issue_label" VALUES(11,9,8); INSERT INTO "issue_label" VALUES(12,8,8); INSERT INTO "issue_label" VALUES(13,7,8); INSERT INTO "issue_label" VALUES(14,10,9); INSERT INTO "issue_label" VALUES(15,9,9); INSERT INTO "issue_label" VALUES(16,8,9); INSERT INTO "issue_label" VALUES(17,30,12); INSERT INTO "issue_label" VALUES(18,29,12); INSERT INTO "issue_label" VALUES(19,31,10); INSERT INTO "issue_label" VALUES(20,32,10); INSERT INTO "issue_label" VALUES(21,33,10); CREATE UNIQUE INDEX `UQE_issue_label_S` ON `issue_label` (`issue_id`,`label_id`); COMMIT; ```
Author
Owner

@stale[bot] commented on GitHub (Jan 20, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 20, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1713