Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 804681 - packages.g.o not updating
Summary: packages.g.o not updating
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: Other web server issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Infrastructure
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-27 22:03 UTC by Harris Landgarten
Modified: 2021-07-28 00:22 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harris Landgarten 2021-07-27 22:03:14 UTC
There hasn't been an update to packages since 7/24
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2021-07-27 23:56:47 UTC
updater_1       | INFO: 2021/07/24 19:40:40 commit.go:29: Finished updating commits
updater_1       | INFO: 2021/07/24 19:45:36 soko.go:55: Updating package data
updater_1       | INFO: 2021/07/24 19:45:36 update.go:31: Start update...
updater_1       | INFO: 2021/07/24 19:45:40 update.go:60: Start updating changed metadata
updater_1       | INFO: 2021/07/24 19:45:40 update.go:80: Start updating changed package data
updater_1       | INFO: 2021/07/24 19:45:40 update.go:98: Start updating the history
updater_1       | INFO: 2021/07/24 19:45:40 commit.go:22: Start updating commits
updater_1       | INFO: 2021/07/24 19:45:40 commit.go:29: Finished updating commits
updater_1       | INFO: 2021/07/24 19:50:36 soko.go:55: Updating package data
updater_1       | INFO: 2021/07/24 19:50:36 update.go:31: Start update...
updater_1       | INFO: 2021/07/24 19:50:40 update.go:60: Start updating changed metadata
updater_1       | INFO: 2021/07/24 19:50:40 mask.go:52: Updating Masks
updater_1       | panic: runtime error: slice bounds out of range [1:0]
updater_1       | 
updater_1       | goroutine 1 [running]:
updater_1       | soko/pkg/portage/repository.parsePackageMask(0xc00064a6dd, 0x199)
updater_1       |       /go/src/soko/pkg/portage/repository/mask.go:115 +0x853
updater_1       | soko/pkg/portage/repository.UpdateMask(0xc0001c4a83, 0x17)
updater_1       |       /go/src/soko/pkg/portage/repository/mask.go:59 +0x16e
updater_1       | soko/pkg/portage.updateMetadata()
updater_1       |       /go/src/soko/pkg/portage/update.go:66 +0xf5
updater_1       | soko/pkg/portage.Update()
updater_1       |       /go/src/soko/pkg/portage/update.go:36 +0x104
updater_1       | main.main()
updater_1       |       /go/src/soko/soko.go:56 +0x928
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2021-07-28 00:00:00 UTC
// parse the package.mask entries and
// update the Mask table in the database
func parsePackageMask(packageMask string) {
	packageMaskLines := strings.Split(packageMask, "\n")
	if len(packageMaskLines) >= 3 {
		packageMaskLine, packageMaskLines := packageMaskLines[0], packageMaskLines[1:]
		author, authorEmail, date := parseAuthorLine(packageMaskLine)

		reason := ""
		packageMaskLine, packageMaskLines = packageMaskLines[0], packageMaskLines[1:]
		for strings.HasPrefix(packageMaskLine, "#") {
			reason = reason + " " + strings.Replace(packageMaskLine, "# ", "", 1)
			packageMaskLine, packageMaskLines = packageMaskLines[0], packageMaskLines[1:]
		}

		packageMaskLines = append(packageMaskLines, packageMaskLine)

		for _, version := range packageMaskLines {
			useflag := &models.Mask{
				Author:      author,
				AuthorEmail: authorEmail,
				Date:        date,
				Reason:      reason,
				Versions:    version,
			}

			_, err := database.DBCon.Model(useflag).OnConflict("(versions) DO UPDATE").Insert()

			if err != nil {
				logger.Error.Println("Error while inserting/updating package mask entry")
				logger.Error.Println(err)
			}
		}
	}

}
Comment 3 Alec Warner (RETIRED) archtester gentoo-dev Security 2021-07-28 00:13:39 UTC
func parsePackageMask(packageMask string) {
        // Split the mask entry into lines
	packageMaskLines := strings.Split(packageMask, "\n")
        // If there are at least 3 lines
	if len(packageMaskLines) >= 3 {
                // Extract the header line, plus the rest.
		packageMaskLine, packageMaskLines := packageMaskLines[0], packageMaskLines[1:]
		author, authorEmail, date := parseAuthorLine(packageMaskLine)

		reason := ""
                // Walk the non-header lines; while they are #-prefixed, append them to the reason.
                // Eventually we should hit a terminating \n and the for loop should terminate.
		packageMaskLine, packageMaskLines = packageMaskLines[0], packageMaskLines[1:]
		for strings.HasPrefix(packageMaskLine, "#") {
			reason = reason + " " + strings.Replace(packageMaskLine, "# ", "", 1)
			packageMaskLine, packageMaskLines = packageMaskLines[0], packageMaskLines[1:]
		}

		packageMaskLines = append(packageMaskLines, packageMaskLine)

		for _, version := range packageMaskLines {
			useflag := &models.Mask{
				Author:      author,
				AuthorEmail: authorEmail,
				Date:        date,
				Reason:      reason,
				Versions:    version,
			}

			_, err := database.DBCon.Model(useflag).OnConflict("(versions) DO UPDATE").Insert()

			if err != nil {
				logger.Error.Println("Error while inserting/updating package mask entry")
				logger.Error.Println(err)
			}
		}
	}

}

So the bug here appears to be that getMasks is returning things without terminating \n's?

https://gitweb.gentoo.org/repo/gentoo.git/commit/profiles/package.mask?id=39e5e3ae11c6ff4775afcb582846bb33f54d66a3

Produces a mask with no atoms, which would probably trigger this bug.
Comment 4 Larry the Git Cow gentoo-dev 2021-07-28 00:17:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bdc6bf035ea471bf1463333cf8c2543a34233f6

commit 6bdc6bf035ea471bf1463333cf8c2543a34233f6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-07-28 00:16:01 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-07-28 00:16:54 +0000

    profiles: drop commented out virtual/perl-Pod-Parser mask
    
    Breaks packages.gentoo.org parsing and pkgdev. We know
    where to find the mask in git history when we want to restore it.
    
    Bug: https://bugs.gentoo.org/804681
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/package.mask | 10 ----------
 1 file changed, 10 deletions(-)
Comment 5 Alec Warner (RETIRED) archtester gentoo-dev Security 2021-07-28 00:22:08 UTC
updater_1       | INFO: 2021/07/28 00:20:36 soko.go:55: Updating package data
updater_1       | INFO: 2021/07/28 00:20:36 update.go:31: Start update...
updater_1       | INFO: 2021/07/28 00:20:40 update.go:60: Start updating changed metadata
updater_1       | INFO: 2021/07/28 00:20:40 mask.go:52: Updating Masks
updater_1       | INFO: 2021/07/28 00:20:40 update.go:80: Start updating changed package data
updater_1       | INFO: 2021/07/28 00:20:41 update.go:98: Start updating the history
updater_1       | INFO: 2021/07/28 00:20:41 commit.go:22: Start updating commits
updater_1       | INFO: 2021/07/28 00:20:43 commit.go:133: Processed commits: 0
updater_1       | INFO: 2021/07/28 00:20:43 commit.go:136: Processed first commit.
updater_1       | INFO: 2021/07/28 00:21:05 commit.go:133: Processed commits: 1000
updater_1       | INFO: 2021/07/28 00:21:15 commit.go:29: Finished updating commits