"Last contact" column on the "Admin Area > Runners" page contains strange data
Summary
Seems like "Last contact" column contains incorrect data at least when sort
is set to contacted_asc
. With older version of GitLab with sort=contacted_asc
I had on top Runners which are offline or were contacted a long time ago, and table was really sorted. After some upgrade (unfortunately I can not say exact version) "Last contact" contains data which I can not understand, numbers are not in order.
After checking DB content I realized that runners are listed in proper order, problem with "Last contact" column which contains wrong datetimes.
Steps to reproduce
Unfortunately I have now ways of reproducing this issue other than on my GitLab instance.
I noticed that contacted_at
which is in a database differs from what I get using API.
gitlabhq_production=> SELECT id, description, contacted_at FROM ci_runners WHERE id = 3;
id | description | contacted_at
----+--------------------------------------+----------------------------
3 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | 2018-07-31 09:50:16.526887
(1 row)
{
"id": 3,
"description": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ip_address": "xx.xxx.xx.xx",
"active": true,
"is_shared": true,
"name": "gitlab-runner",
"online": true,
"status": "online",
"tag_list": [
"xxxxx",
"xxxxxxxxxxxx"
],
"run_untagged": false,
"locked": false,
"maximum_timeout": 7200,
"access_level": "not_protected",
"version": "10.2.0",
"revision": "0a75cdd1",
"platform": "linux",
"architecture": "amd64",
"contacted_at": "2018-07-31T17:34:02.815+07:00",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"projects": [],
"groups": []
}
Example Project
-
What is the current bug behavior?
"Last contact" column contains numbers which are not in order when sort=contacted_asc
is used.
What is the expected correct behavior?
"Last contact" column must contains numbers which are in order.
Relevant logs and/or screenshots
Output of checks
-
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 8.11 Current User: git Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.17.1 Sidekiq Version:5.1.3 Go Version: unknownGitLab information Version: 11.1.2 Revision: 35936b0 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://example.com HTTP Clone URL: https://example.com/some-group/some-project.git SSH Clone URL: git@example.com:some-group/some-project.git Using LDAP: yes Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 7.1.4 Repository storage paths: default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 7.1.4 ? ... OK (7.1.4) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 91/1 ... ok 8/3 ... ok 91/5 ... ok 4/8 ... ok 8/10 ... ok 8/11 ... ok 2/12 ... ok 91/13 ... ok 91/14 ... ok 8/15 ... ok 91/16 ... ok 91/17 ... ok 91/18 ... ok 4/21 ... ok 102/22 ... ok 79/23 ... ok 79/24 ... ok 79/25 ... ok 23/27 ... ok 23/28 ... ok 91/30 ... ok 91/31 ... ok 92/32 ... ok 8/33 ... ok 4/34 ... ok 114/36 ... ok 8/37 ... ok 4/39 ... ok 4/40 ... ok 7/41 ... ok 111/42 ... ok 111/43 ... ok 111/44 ... ok 91/45 ... ok 7/46 ... ok 23/47 ... ok 7/49 ... ok 102/50 ... ok 111/51 ... ok 8/52 ... ok 111/53 ... ok 8/54 ... ok 111/55 ... ok 5/56 ... ok 114/57 ... ok 114/58 ... ok 91/59 ... ok 111/60 ... ok 102/63 ... ok 8/64 ... ok 8/65 ... ok 58/66 ... ok 58/67 ... ok 111/68 ... ok 111/69 ... ok 40/70 ... ok 39/71 ... ok 14/72 ... ok 4/73 ... ok 111/74 ... ok 18/75 ... ok 14/76 ... ok 4/77 ... ok 111/79 ... ok 21/80 ... ok 4/81 ... ok 4/82 ... ok 4/83 ... ok 4/84 ... ok 4/85 ... ok 4/86 ... ok 4/87 ... ok 4/88 ... ok 4/89 ... ok 4/90 ... ok 4/91 ... ok 7/92 ... ok 91/93 ... ok 8/98 ... ok 111/99 ... ok 50/101 ... ok 91/102 ... ok 91/104 ... ok 58/105 ... ok 57/106 ... ok 29/107 ... ok 29/108 ... repository is empty 57/110 ... ok 58/112 ... ok 91/113 ... ok 29/115 ... repository is empty 36/116 ... ok 36/117 ... ok 36/118 ... ok 112/119 ... ok 36/120 ... ok 36/124 ... ok 36/126 ... ok 85/135 ... ok 4/155 ... ok 29/156 ... ok 61/161 ... ok 91/162 ... ok 91/163 ... ok 91/164 ... ok 91/165 ... ok 91/166 ... ok 91/167 ... ok 91/168 ... ok 91/169 ... ok 91/170 ... ok 36/183 ... repository is empty 36/184 ... ok 11/185 ... repository is empty 71/186 ... ok 85/187 ... ok 64/190 ... ok 85/192 ... ok 36/193 ... ok 84/194 ... ok 114/195 ... ok 84/196 ... ok 91/197 ... ok 112/198 ... ok 74/199 ... ok 29/200 ... ok 74/201 ... ok 74/202 ... ok 75/203 ... ok 75/204 ... ok 75/205 ... ok 29/206 ... repository is empty 112/207 ... ok 79/209 ... ok 79/212 ... ok 91/213 ... ok 74/215 ... ok 11/220 ... repository is empty 91/221 ... ok 91/222 ... ok 91/223 ... ok 70/225 ... ok 79/226 ... repository is empty 29/227 ... ok 88/228 ... ok 85/230 ... repository is empty 85/231 ... ok 88/232 ... ok 4/233 ... repository is empty 79/234 ... ok 89/235 ... ok 71/236 ... ok 71/237 ... ok 71/238 ... ok 37/239 ... ok 79/240 ... ok 91/241 ... ok 92/242 ... ok 95/245 ... ok 95/246 ... ok 95/247 ... ok 95/248 ... ok 95/249 ... ok 95/250 ... ok 101/251 ... ok 101/252 ... ok 101/253 ... ok 101/254 ... ok 101/255 ... ok 101/256 ... ok 101/257 ... ok 101/258 ... ok 101/259 ... ok 101/260 ... ok 101/261 ... ok 101/262 ... ok 101/263 ... ok 101/264 ... ok 101/265 ... ok 101/266 ... ok 101/267 ... ok 101/268 ... ok 101/269 ... ok 101/270 ... ok 101/271 ... ok 101/272 ... ok 101/273 ... ok 101/274 ... ok 101/275 ... ok 101/276 ... ok 101/277 ... ok 101/278 ... ok 101/279 ... ok 101/280 ... ok 101/281 ... ok 101/282 ... ok 101/283 ... ok 101/284 ... ok 101/285 ... ok 101/286 ... ok 101/287 ... ok 101/288 ... ok 101/289 ... ok 101/290 ... ok 101/291 ... ok 101/292 ... ok 101/293 ... ok 101/294 ... ok 101/295 ... ok 101/296 ... ok 101/297 ... ok 101/298 ... ok 101/299 ... ok 101/300 ... ok 101/301 ... ok 101/302 ... ok 91/303 ... ok 79/304 ... ok 91/305 ... ok 91/306 ... ok 91/307 ... ok 91/308 ... ok 91/309 ... ok 91/310 ... ok 91/311 ... ok 91/312 ... ok 102/313 ... ok 103/314 ... ok 16/315 ... ok 103/316 ... ok 103/317 ... ok 103/318 ... ok 102/320 ... ok 102/322 ... ok 102/323 ... ok 88/324 ... ok 107/325 ... repository is empty 107/326 ... repository is empty 107/327 ... repository is empty 107/328 ... repository is empty 107/329 ... repository is empty 107/330 ... repository is empty 107/331 ... repository is empty 107/332 ... repository is empty 107/333 ... repository is empty 107/334 ... repository is empty 107/335 ... repository is empty 107/336 ... repository is empty 107/337 ... repository is empty 85/338 ... ok 103/339 ... repository is empty 102/340 ... ok 62/341 ... ok 4/342 ... ok 103/343 ... ok 88/344 ... ok 103/345 ... ok 30/350 ... ok 69/351 ... ok 115/352 ... ok 115/353 ... ok 115/354 ... ok 115/355 ... ok 115/356 ... ok 115/357 ... ok 115/358 ... ok 60/359 ... ok 111/360 ... ok 103/364 ... ok 4/365 ... ok 91/367 ... ok 16/368 ... ok 111/369 ... ok 111/370 ... ok 111/371 ... ok 111/372 ... ok 111/373 ... ok 111/374 ... ok 125/376 ... ok 115/377 ... ok 36/378 ... ok 111/379 ... ok 14/380 ... ok 3/381 ... repository is empty Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml Checking LDAP ...
Server: ldapmain not verifying SSL hostname of LDAPS server 'example.com:636' LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results)
...
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 91/1 ... yes 8/3 ... yes 91/5 ... yes 4/8 ... yes 8/10 ... yes 8/11 ... yes 2/12 ... yes 91/13 ... yes 91/14 ... yes 8/15 ... yes 91/16 ... yes 91/17 ... yes 91/18 ... yes 4/21 ... yes 102/22 ... yes 79/23 ... yes 79/24 ... yes 79/25 ... yes 23/27 ... yes 23/28 ... yes 91/30 ... yes 91/31 ... yes 92/32 ... yes 8/33 ... yes 4/34 ... yes 114/36 ... yes 8/37 ... yes 4/39 ... yes 4/40 ... yes 7/41 ... yes 111/42 ... yes 111/43 ... yes 111/44 ... yes 91/45 ... yes 7/46 ... yes 23/47 ... yes 7/49 ... yes 102/50 ... yes 111/51 ... yes 8/52 ... yes 111/53 ... yes 8/54 ... yes 111/55 ... yes 5/56 ... yes 114/57 ... yes 114/58 ... yes 91/59 ... yes 111/60 ... yes 102/63 ... yes 8/64 ... yes 8/65 ... yes 58/66 ... yes 58/67 ... yes 111/68 ... yes 111/69 ... yes 40/70 ... yes 39/71 ... yes 14/72 ... yes 4/73 ... yes 111/74 ... yes 18/75 ... yes 14/76 ... yes 4/77 ... yes 111/79 ... yes 21/80 ... yes 4/81 ... yes 4/82 ... yes 4/83 ... yes 4/84 ... yes 4/85 ... yes 4/86 ... yes 4/87 ... yes 4/88 ... yes 4/89 ... yes 4/90 ... yes 4/91 ... yes 7/92 ... yes 91/93 ... yes 8/98 ... yes 111/99 ... yes 50/101 ... yes 91/102 ... yes 91/104 ... yes 58/105 ... yes 57/106 ... yes 29/107 ... yes 29/108 ... yes 57/110 ... yes 58/112 ... yes 91/113 ... yes 29/115 ... yes 36/116 ... yes 36/117 ... yes 36/118 ... yes 112/119 ... yes 36/120 ... yes 36/124 ... yes 36/126 ... yes 85/135 ... yes 4/155 ... yes 29/156 ... yes 61/161 ... yes 91/162 ... yes 91/163 ... yes 91/164 ... yes 91/165 ... yes 91/166 ... yes 91/167 ... yes 91/168 ... yes 91/169 ... yes 91/170 ... yes 36/183 ... yes 36/184 ... yes 11/185 ... yes 71/186 ... yes 85/187 ... yes 64/190 ... yes 85/192 ... yes 36/193 ... yes 84/194 ... yes 114/195 ... yes 84/196 ... yes 91/197 ... yes 112/198 ... yes 74/199 ... yes 29/200 ... yes 74/201 ... yes 74/202 ... yes 75/203 ... yes 75/204 ... yes 75/205 ... yes 29/206 ... yes 112/207 ... yes 79/209 ... yes 79/212 ... yes 91/213 ... yes 74/215 ... yes 11/220 ... yes 91/221 ... yes 91/222 ... yes 91/223 ... yes 70/225 ... yes 79/226 ... yes 29/227 ... yes 88/228 ... yes 85/230 ... yes 85/231 ... yes 88/232 ... yes 4/233 ... yes 79/234 ... yes 89/235 ... yes 71/236 ... yes 71/237 ... yes 71/238 ... yes 37/239 ... yes 79/240 ... yes 91/241 ... yes 92/242 ... yes 95/245 ... yes 95/246 ... yes 95/247 ... yes 95/248 ... yes 95/249 ... yes 95/250 ... yes 101/251 ... yes 101/252 ... yes 101/253 ... yes 101/254 ... yes 101/255 ... yes 101/256 ... yes 101/257 ... yes 101/258 ... yes 101/259 ... yes 101/260 ... yes 101/261 ... yes 101/262 ... yes 101/263 ... yes 101/264 ... yes 101/265 ... yes 101/266 ... yes 101/267 ... yes 101/268 ... yes 101/269 ... yes 101/270 ... yes 101/271 ... yes 101/272 ... yes 101/273 ... yes 101/274 ... yes 101/275 ... yes 101/276 ... yes 101/277 ... yes 101/278 ... yes 101/279 ... yes 101/280 ... yes 101/281 ... yes 101/282 ... yes 101/283 ... yes 101/284 ... yes 101/285 ... yes 101/286 ... yes 101/287 ... yes 101/288 ... yes 101/289 ... yes 101/290 ... yes 101/291 ... yes 101/292 ... yes 101/293 ... yes 101/294 ... yes 101/295 ... yes 101/296 ... yes 101/297 ... yes 101/298 ... yes 101/299 ... yes 101/300 ... yes 101/301 ... yes 101/302 ... yes 91/303 ... yes 79/304 ... yes 91/305 ... yes 91/306 ... yes 91/307 ... yes 91/308 ... yes 91/309 ... yes 91/310 ... yes 91/311 ... yes 91/312 ... yes 102/313 ... yes 103/314 ... yes 16/315 ... yes 103/316 ... yes 103/317 ... yes 103/318 ... yes 102/320 ... yes 102/322 ... yes 102/323 ... yes 88/324 ... yes 107/325 ... yes 107/326 ... yes 107/327 ... yes 107/328 ... yes 107/329 ... yes 107/330 ... yes 107/331 ... yes 107/332 ... yes 107/333 ... yes 107/334 ... yes 107/335 ... yes 107/336 ... yes 107/337 ... yes 85/338 ... yes 103/339 ... yes 102/340 ... yes 62/341 ... yes 4/342 ... yes 103/343 ... yes 88/344 ... yes 103/345 ... yes 30/350 ... yes 69/351 ... yes 115/352 ... yes 115/353 ... yes 115/354 ... yes 115/355 ... yes 115/356 ... yes 115/357 ... yes 115/358 ... yes 60/359 ... yes 111/360 ... yes 103/364 ... yes 4/365 ... yes 91/367 ... yes 16/368 ... yes 111/369 ... yes 111/370 ... yes 111/371 ... yes 111/372 ... yes 111/373 ... yes 111/374 ... yes 125/376 ... yes 115/377 ... yes 36/378 ... yes 111/379 ... yes 14/380 ... yes 3/381 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.4.4) Git version >= 2.9.5 ? ... yes (2.17.1) Git user has default SSH configuration? ... yes Active users: ... 69
Checking GitLab ... Finished
Possible fixes
- Sub-optimal solution is to use values which are taken from a database when they are about to be shown in Web UI: !21627 (merged)
- More optimal way is to order runners using not values from the DB but using up-to-date values which are taken from the cache.