Still getting mirror list error after setting custom mirror_type to none

I tried applying the mirror_type fix to my custom repo in my custom.conf file but even after rebooting am still seeing the same error. Is there somewhere else I need to change this?
 
Code:
~]$ cat /usr/local/etc/pkg/repos/custom.conf
custom: {
        url: "http://192.168.n.n/15amd64-local-kjpservers",
        mirror_type: "none",
        enabled: yes,
}

# pkg repos
FreeBSD-ports: { 
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
FreeBSD-ports-kmods: { 
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/kmods_quarterly_1",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
FreeBSD-base: { 
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1",
    enabled         : no,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkgbase-15"
  }
custom: { 
    url             : "http://192.168.n.n/15amd64-local-kjpservers",
    enabled         : yes,
    priority        : 0,
    signature_type  : "NONE"
  }

(Local IP address hidden.)
 
Is that a Poudriere repository? I am using one from local filesystem, just tried http-way and it seems to work fine with just the url, no mirror_type defined.

Code:
$ cat /usr/local/etc/pkg/repos/Poudriere*
Poudriere: { url="file:///usr/local/poudriere/data/packages/144amd64-main" }
Poudriere2: { url: "http://0.0.0.0:3169" }
 
Since I'm fully up-to-date it's too late to answer that question.

Interesting. The line doesn't seem to be needed at all. Perhaps it defaults to "none". However, I'm upgrading jails with
pkg -j jailname upgrade
and it seems each jail has its own custom.conf file. I had assumed since I was using pkg in the host those jails' files wouldn't be used, but maybe they are. When I tried to edit them I found they were read only, however, so I'm puzzled now.
 
Reading the pkg 2.7.5 code, in libpkg/pkg_config.c, there is:

Code:
if (mirror_type != NULL) {
        if (STRIEQ(mirror_type, "srv"))
            r->mirror_type = SRV;
        else if (STRIEQ(mirror_type, "http"))
            r->mirror_type = HTTP;
        else
            r->mirror_type = NOMIRROR;
}

So, valid values are srv and http. Anything else gives NOMIRROR.
If you put nothing or none or toto, it's all the same.
 
The current version is 2.8.4 and that is where the behaviour has changed since 2.8.1, so what the code was in 2.7.5 is not relevant. It is the code in 2.8.4 we need to see. I'm struggling to find where I can download or see that.
 
I'm struggling to find where I can download or see that.
C:
    if (mirror_type != NULL) {
        if (STRIEQ(mirror_type, "srv"))
            r->mirror_type = SRV;
        else if (STRIEQ(mirror_type, "http"))
            r->mirror_type = HTTP;
        else
            r->mirror_type = NOMIRROR;
    }
In github you can browse source code of a specific tag such as 2.8.4.
 
The current version is 2.8.4 and that is where the behaviour has changed since 2.8.1, so what the code was in 2.7.5 is not relevant. It is the code in 2.8.4 we need to see. I'm struggling to find where I can download or see that.
And you seriously think it changed on this point?

I took 2.7.5 because I had this in my ports tree (I have 2.8.4 as package). make fetch extract and then grep mirror_type. I didn't find a way to grep on github. Maybe someone knows?
 
And the answer is here:
C:
static struct pkg_repo *
pkg_repo_new(const char *name, const char *url, const char *type)
{
    struct pkg_repo *r;

    r = xcalloc(1, sizeof(struct pkg_repo));
    r->dfd = -1;
    r->ops = pkg_repo_find_type(type);
    r->url = xstrdup(url);
    r->signature_type = SIG_NONE;
    r->mirror_type = NOMIRROR;
    r->enable = true;
    r->rwhich_database = true;
    r->meta = pkg_repo_meta_default();
    r->name = xstrdup(name);
    vec_push(&repos, r);

    return (r);
}

So there is a default of NOMIRROR if the line is NULL or missing. The behaviour which has changed is that for some reason if HTTP is specified port :80 is added which shouldn't matter since that is the correct port for HTTP but it now seems to cause pkg to choke on the download and try again without it, which succeeds.

As for whether version matters, if people report a change in behaviour between two versions (in this case 2.8.1 and 2.8.4) there's little point looking for information in an even earlier version to diagnose the problem.
 
This is the 2.7.5 code. It's exactly the same.
C:
static struct pkg_repo *
pkg_repo_new(const char *name, const char *url, const char *type)
{
    struct pkg_repo *r;

    r = xcalloc(1, sizeof(struct pkg_repo));
    r->dfd = -1;
    r->ops = pkg_repo_find_type(type);
    r->url = xstrdup(url);
    r->signature_type = SIG_NONE;
    r->mirror_type = NOMIRROR;
    r->enable = true;
    r->meta = pkg_repo_meta_default();
    r->name = xstrdup(name);
    DL_APPEND(repos, r);

    return (r);
}
 
Yeah, that's not the change, but it does explain why leaving the line out is equivalent to "none", which is the particular question I had. It confirms there are defaults. I don't know what has changed in 2.8.4 but something has.

Now I need to find out why I can't change the jail repo files even as root, in case they're being read.

Update: I'd set them immutable. Once I cleared the flag I could edit them. Now to see whether the problem persists next time I upgrade packages.
 
Back
Top