go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.39k stars 5.43k forks source link

Activity pages (besides Pulse) brocken - Server sends negative Unix-time #31248

Closed snoweuph closed 4 months ago

snoweuph commented 4 months ago

Description

The Activity Tab are loading a long time, and then are just empty. This does not seeme to be the same problem as: #30851

This happens to all Repos on my Instance:. Test Repo: https://git.euph.dev/Snoweuph/Dotfiles/activity/contributors

it looks like my server is sending negative unix time: https://git.euph.dev/Snoweuph/Dotfiles/activity/contributors/data specificly all unixtimestamps are -62135596800000

Gitea Version

22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://pastebin.com/LU9eVE2W

Screenshots

image image

Git Version

2.20.1

Operating System

Debian 10 - Kernel 4.19.0-26

How are you running Gitea?

I run gitea as a Systemd Service.

gitea.service

[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target

[Service]
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea

[Install]
WantedBy=multi-user.target

app.ini

APP_NAME = Giteuph
RUN_USER = git
RUN_MODE = prod
WORK_PATH = /var/lib/gitea

[oauth2]
JWT_SECRET = ...

[security]
INTERNAL_TOKEN = ...
INSTALL_LOCK = true
SECRET_KEY = ...

[database]
DB_TYPE = mysql
HOST = 127.0.0.1:3306
NAME = gitea
USER = gitea
PASSWD = ...
SCHEMA =
SSL_MODE = disable
CHARSET = utf8
PATH = /var/lib/gitea/data/gitea.db
LOG_SQL = false

[repository]
ROOT = /home/git/gitea-repositories

[attachment]
MAX_SIZE = 1000

[server]
SSH_DOMAIN = git.euph.dev
DOMAIN = git.euph.dev
HTTP_PORT = 3000
ROOT_URL = https://git.euph.dev/
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_JWT_SECRET = ...
OFFLINE_MODE = false

[storage.packages]
STORAGE_TYPE = local
PATH = /mnt/gitea-data/packages

[mailer]
ENABLED = true
SMTP_ADDR = box.euph.email:465
FROM = noreply@euph.email
USER = noreply@euph.email
PASSWD = ...

[service]
REGISTER_EMAIL_CONFIRM = true
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = true
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.localhost

[picture]
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = false

[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false

[session]
PROVIDER = file

[log]
MODE = file
LEVEL = info
ROOT_PATH = /var/lib/gitea/log
REDIRECT_MACARON_LOG = true
MACARON = console

[ui]
THEMES = gitea-auto,gitea-light,gitea-dark,catppuccin-latte-blue,catppuccin-latte-flamingo,catppuccin-latte-green,catppuccin-latte-lavender,catppuccin-latte-maroon,catppuccin-latte-mauve,catppuccin-latte-peach,catppuccin-latte-pink,cat$
DEFAULT_THEME = gitea-auto

[actions]
ENABLED = true

Database

MySQL/MariaDB

snoweuph commented 4 months ago

I did a small test, to make sure that the go time lib works, and it seems to look fine:

root@euph:~/test# cat main.go 
package main

import (
        "fmt"
        "time"
)

func main() {
        now := time.Now()
        fmt.Println("The current time and date is:", now)
}
root@euph:~/test# go run main.go 
The current time and date is: 2024-06-04 15:35:18.373897005 +0000 UTC m=+0.000015481
snoweuph commented 4 months ago

@kemzeb you said:

After looking at the code that builds these Unix times, I haven't been able to determine the cause (or if the problem resides elsewhere). If you wish, you can open a new issue so that we can track this potential bug.

so, i'm just now building a gitea binary myself, based on the v22 tag and i'm changing it up to return the startingOfWeek as debugging data

snoweuph commented 4 months ago

well, my compiled binary ( compiled on the Server) directly crashes (using make build) so I guess, I will have to try somethign else

snoweuph commented 4 months ago

I fixed it, by installing a nwer git version with sha256 support (the newest one) from source.

the git on debian 10 is to old

snoweuph commented 4 months ago

On Linode Debian 10, the git version is 2.20 which is not working with the new version of gitea, solution: install git from source

kemzeb commented 4 months ago

Glad that you were able to solve it! Did not expect it to be because of an outdated git

snoweuph commented 4 months ago

Yea, same