-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jail profile] pkg: Repository Synth has a wrong packagesite #237
Comments
"Repository Synth has a wrong packagesite, need to re-create database" is a message from pkg, not synth. I'm not an expert on pkg but presumably this is all normal based on your specific setup |
Yeah, but isn't it configured by Synth? There is no /usr/local/etc/pkg/repos/00_synth.conf inside jail, what did I miss? |
does it happen every time or just that one time? |
I switched profile back to LiveSystem for trying to build older xterm (has some locale bug in vim) and got same message after answering Y to question - so probably that's "every time" |
Porters in our Telegram supposed that's new unexpected changes in pkg as a side-effect fro new pkgbase shlib tracking etc. |
you need to repeat in the same profile before you can determine if it's repeatable. |
I looked at pkg sources and found in /* Check package site */
char *req = sqlite3_mprintf("select count(key) from repodata "
"WHERE key = \"packagesite\" and value = '%q'", pkg_repo_url(repo));
res = 0;
get_pragma(sqlite, req, &res, true);
sqlite3_free(req);
if (res != 1) {
pkg_emit_error("Repository %s has a wrong packagesite, need to "
"re-create database", repo->name);
sqlite3_close(sqlite);
return (EPKG_FATAL);
} i.e. it means if several records found for So I opened Now I suspect that what happened is: synth on profile for jail did record to system's BTW I did
but that's probably OK. |
so the majority of pkg actions occur inside the builder where the environment is specified, including several pkg settings. i don't know - sounds like PKG_DBDIR might need to be overridden for edge usage like yours for those host pkg operations. I need to check the code. |
FYI - I haven't done this yet, crazy week at work |
I confirm the host pkg is the one that executes the "repo" command. |
I also confirm PKG_DBDIR is not being set in the environment OR the command line. That's probably the issue. |
can you post the contentions of /usr/local/etc/synth/synth.ini ? I want to see how you've set up the jail profile. |
On Mon, 03 Mar 2025 17:08:49 -0800 jrmarino ***@***.***> wrote:
can you post the contentions of /usr/local/etc/synth/synth.ini ? I want to
see how you've set up the jail profile.
```
; This Synth configuration file is automatically generated
; Take care when hand editing!
[Global Configuration]
profile_selected= LiveSystem
[LiveSystem]
Operating_system= FreeBSD
Directory_packages= /zp/bsd/synth/live_packages
Directory_repository= /zp/bsd/synth/live_packages/All
Directory_portsdir= /usr/ports
Directory_options= /var/db/ports
Directory_distfiles= /usr/ports/distfiles
Directory_buildbase= /usr/obj/synth-live
Directory_logs= /var/log/synth
Directory_ccache= disabled
Directory_system= /
Number_of_builders= 2
Max_jobs_per_builder= 3
Tmpfs_workdir= false
Tmpfs_localbase= true
Display_with_ncurses= true
leverage_prebuilt= true
[Repo1]
Operating_system= FreeBSD
Directory_packages= /zp/bsd/repo1/synth/packages
Directory_repository= /zp/bsd/repo1/synth/packages/All
Directory_portsdir= /zp/bsd/repo1/uports
Directory_options= /zp/bsd/repo1/dbports
Directory_distfiles= /usr/ports/distfiles
Directory_buildbase= /usr/obj/synth-repo1
Directory_logs= /zp/bsd/repo1/synth/log
Directory_ccache= disabled
Directory_system= /usr/obj/jclassic
Number_of_builders= 2
Max_jobs_per_builder= 3
Tmpfs_workdir= false
Tmpfs_localbase= true
Display_with_ncurses= true
leverage_prebuilt= true
```
…--
WBR, @nuclight
|
My theory is that if directory system == "/" do not modify the repo command (use PKG_DBDIR setting that pkg is configured for), otherwise insert this fragment in the host pkg repo command:
I can create a branch with this change. Could you then build synth to that git hash by modifying synth Makefile and running "make makesum", install it and test it? |
Yes, I can build/install/test (though it make take time for another jail) branch. But may be a separate setting for profile needed - can we break here something for existing "profiles" feature users, or it's safe to insert? Also, for case profile is of thick jail, probably synth's repo should be added to |
I don't think you need to create a new jail. You could even build the branch on the LiveSystem profile, install it, and then test it on the Repo1 profile that you are using. It would be a minor change that shouldn't break anything. |
hmm, I misread the code. it's only using the host pkg when the signing server is being used, but normal repo generations use the builder's pkg8. |
can you run "pkg -vv" and show the output after "Repositories:", e.g.
|
That's what on host currently (was busy with work, didn't build anything yet):
|
but the discussed problem is when it tries to update (live) system, so it's some third variant of |
I'm trying to figure out which package database is being used that could be getting multiple definitions of the packagesite. Obviously your use of prefetch is a factor here. I am struggling to reproduce this in my head. Can you clarify does this error ONLY happen in profile Repo1, or does it happen in the LiveSystem profile too? |
here's something I don't understand. You show in the Repo1 profile that you are building packages here: /zp/bsd/repo1/synth/packages but your pkg repository configuration is something else: file:///zp/bsd/synth/live_packages shouldn't it be file:///zp/bsd/repo1/synth/packages ? is there some kind of move task I don't know about? |
Currently I can't reproduce on LiveSystem. It was switched to, according to
I wish some debug of spawned processes would exist, at least |
Yes, that profile was planned for brand new classic jail to put firefox in it.
Yes, it is that on host since 20 Feb when I switched profile back to LiveSystem.
I was expecting
Just for completeness, here's tail of
|
so when you say yes, you want to upgrade now, this command is run:
which means when you build with profile Repo1, you are not installing with the packages you just built. so if you want to install from packages built by Repo1, either
unless I'm missing something, this repository definition is your main issue for upgrading the packages with a local repository. |
Created a profile for a fresh clean jail, switched to it and did
synth build www/firefox
. At the end (non-first run, Ctrl-Q used on earlier incarnation) synth asked about upgrading system (the jail specified as root as I expect) with built pkgs, but that failed. Not critical as can be done manually, but still...The text was updated successfully, but these errors were encountered: