build error: "sqlite error while executing INSERT"

Started by gondox, July 21, 2022, 11:05:45 AM

Previous topic - Next topic
I think you can bootstrap from FreeBSD against https://pkg.opnsense.org/FreeBSD:13:amd64/22.7/latest/Latest/pkg.pkg before installing git, but I don't have a system to check at this moment.


Cheers,
Franco

Thanks for the link, I tried to curl it but curl isn't installed in the beginning. So I thought about moving it over with a usb thumb drive.
But then I saw that there is only a amd64 version and not an aarch64 version in https://pkg.opnsense.org/ . And I am building on a raspberry pi, . . . so no idea how to figure this out.

Ok, so I did some more testing yesterday:
1. I set a new install of Freebsd 13.1
2. I used git and make update to get the OPNsense sources
3. I created the 1.17.5 package from the OPNsense sources
4. Transfered the created package to my PC via scp
5. Formated the whole raspberry pi sdcard and set up a fresh Freebsd 13.1 installation
6. Transfered the 1.17.5 package to the fresh install
7. Forced the installation of 1.17.5 pkg
and the result was: pkg 1.18 was invoked to downgrade pkg and thereby modified the sqlite database => back to square one


root@generic:/home/freebsd # ls
.cshrc .login_conf .mailrc .shrc pkg-1.17.5_1.pkg
.login .mail_aliases .profile .ssh
root@generic:/home/freebsd # pkg install --force pkg-1.17.5_1.pkg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:aarch64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.18.3...
Extracting pkg-1.18.3: 100%
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01   
Fetching packagesite.pkg: 100%    6 MiB   6.3MB/s    00:01   
Processing entries: 100%
FreeBSD repository update completed. 30551 packages processed.
All repositories are up to date.
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be DOWNGRADED:
pkg: 1.18.3 -> 1.17.5_1

Number of packages to be downgraded: 1

The operation will free 2 MiB.

Proceed with this action? [y/N]: y
[1/1] Downgrading pkg from 1.18.3 to 1.17.5_1...
Extracting pkg-1.17.5_1: 100%
root@generic:/home/freebsd # pkg install git
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: warning: database version 36 is newer than libpkg(3) version 35, but still compatible
pkg: sqlite error while executing INSERT OR IGNORE INTO mtree(content) VALUES(?1) in file pkgdb.c:115: no such table: mtree
root@generic:/home/freebsd #


@astronaut: I have no idea how you did it, if you tried again, would you be able to fix it on a new install? If so, can you tell me?

I think I figured out how to work around this problem, but it is incredibly clunky:

1. I set a new install of Freebsd 13.1
2. I used git and make update to get the OPNsense sources
3. I copied the /usr/ports/ directory to a remote PC via scp
5. Formated the whole raspberry pi sdcard and set up a fresh Freebsd 13.1 installation
6. Transfered the the copied sources back to the new install
7. went to the copy directory and did the following steps:
    # cd /pathtofolder/ports-mgmt/pkg
    # make package
    # make deinstall
    # make install
8. locked pkg with "pkg lock pkg"

and the proceeded with the steps in the README.

The RPI config asks for qemu-user-static, but there is none in the packages (pkg search qemu-user-static) and when I try to build it from the OPNsense sources via "make package" it tells me aarch64 is not supported. As I am compiling on a raspberry pi with aarch64, I think I shouldn't need an emulator, but who knows.

It is compiling "make arm DEVICE="RPI"" at the moment, we will see how it works out.

Huh, that's weird. The only thing that I can think of is the following: While trying different stuff out, I did a#pkg search pkg This listed (among others) pkg-devel-1.17.99.1. As the version number1.17.99.1 was lower than the official pkg one (1.18.something), I simply tried it out with pkg install --force. It didn't work, the error while building OPNsense remained, but maybe this was the intermediate step that allowed me to install the pkg in the way that franco describes?

Hello,
What am I missing ? I followed the steps mentioned above but I receive the attached error, while trying to make the packages.
TY

@nabrog87: Did you look into the log file as stated in the error message? However, this looks like something different enough that it might be better to open a new topic.

hello, here is the log, thank you

QuoteInvoked as: ./configure
Tclsh: /usr/obj/usr/tools/config/22.7/OpenSSL:aarch64/usr/obj/usr/ports/ports-mgmt/pkg/work/pkg-1.17.5/jimsh0
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:4:7: error: use of undeclared identifier 'F_CLOSEM'
(void)F_CLOSEM;
      ^
1 error generated.
============
The failed code was:
#include <fcntl.h>
int main(void) {
#ifndef F_CLOSEM
(void)F_CLOSEM;
#endif
return 0;
}
============
Failed: cc -g -O2 conftest__.c -o conftest__
ld: error: undefined symbol: arc4random_stir
>>> referenced by conftest__.c:3
>>>               /tmp/conftest__-1765d9.o:(main)
>>> did you mean: arc4random_stir@FBSD_1.0
>>> defined in: /lib/libc.so.7
cc: error: linker command failed with exit code 1 (use -v to see invocation)
============
The failed code was:
extern void arc4random_stir(void);
int main(void) {
arc4random_stir();
return 0;
}
============
Failed: cc -g -O2 conftest__.c -o conftest__
ld: error: undefined symbol: basename_r
>>> referenced by conftest__.c:3
>>>               /tmp/conftest__-813738.o:(main)
>>> did you mean: basename_r@FBSD_1.2
>>> defined in: /lib/libc.so.7
cc: error: linker command failed with exit code 1 (use -v to see invocation)
============
The failed code was:
extern void basename_r(void);
int main(void) {
basename_r();
return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'sys/statfs.h' file not found
#include <sys/statfs.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <sys/statfs.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'endian.h' file not found
#include <endian.h>
         ^~~~~~~~~~
1 error generated.
============
The failed code was:
#include <endian.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o -lelf
cc: warning: -lelf: 'linker' input unused [-Wunused-command-line-argument]
conftest__.c:2:1: error: use of undeclared identifier 'Elf_Note'
Elf_Note _x;
^
1 error generated.
============
The failed code was:
int main(void) {
Elf_Note _x;
return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/err.h' file not found
#include <bsd/err.h>
         ^~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/err.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/libutil.h' file not found
#include <bsd/libutil.h>
         ^~~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/libutil.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/readpassphrase.h' file not found
#include <bsd/readpassphrase.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/readpassphrase.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/stdio.h' file not found
#include <bsd/stdio.h>
         ^~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/stdio.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/stdlib.h' file not found
#include <bsd/stdlib.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/stdlib.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/strlib.h' file not found
#include <bsd/strlib.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/strlib.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/string.h' file not found
#include <bsd/string.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/string.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/sys/cdefs.h' file not found
#include <bsd/sys/cdefs.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/sys/cdefs.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/unistd.h' file not found
#include <bsd/unistd.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/unistd.h>
int main(void) {

return 0;
}
============
pkg-config --modversion atf-c : Package atf-c was not found in the pkg-config search path.
Perhaps you should add the directory containing `atf-c.pc'
to the PKG_CONFIG_PATH environment variable
Package 'atf-c', required by 'virtual:world', not found
root@freebsd:/usr/tools #
root@freebsd:/usr/tools #
root@freebsd:/usr/tools #
root@freebsd:/usr/tools # cat /usr/obj/usr/tools/config/22.7/OpenSSL:aarch64/usr/obj/usr/ports/ports-mgmt/pkg/work/pkg-1.17.5/config.log
Invoked as: ./configure
Tclsh: /usr/obj/usr/tools/config/22.7/OpenSSL:aarch64/usr/obj/usr/ports/ports-mgmt/pkg/work/pkg-1.17.5/jimsh0
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:4:7: error: use of undeclared identifier 'F_CLOSEM'
(void)F_CLOSEM;
      ^
1 error generated.
============
The failed code was:
#include <fcntl.h>
int main(void) {
#ifndef F_CLOSEM
(void)F_CLOSEM;
#endif
return 0;
}
============
Failed: cc -g -O2 conftest__.c -o conftest__
ld: error: undefined symbol: arc4random_stir
>>> referenced by conftest__.c:3
>>>               /tmp/conftest__-1765d9.o:(main)
>>> did you mean: arc4random_stir@FBSD_1.0
>>> defined in: /lib/libc.so.7
cc: error: linker command failed with exit code 1 (use -v to see invocation)
============
The failed code was:
extern void arc4random_stir(void);
int main(void) {
arc4random_stir();
return 0;
}
============
Failed: cc -g -O2 conftest__.c -o conftest__
ld: error: undefined symbol: basename_r
>>> referenced by conftest__.c:3
>>>               /tmp/conftest__-813738.o:(main)
>>> did you mean: basename_r@FBSD_1.2
>>> defined in: /lib/libc.so.7
cc: error: linker command failed with exit code 1 (use -v to see invocation)
============
The failed code was:
extern void basename_r(void);
int main(void) {
basename_r();
return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'sys/statfs.h' file not found
#include <sys/statfs.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <sys/statfs.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'endian.h' file not found
#include <endian.h>
         ^~~~~~~~~~
1 error generated.
============
The failed code was:
#include <endian.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o -lelf
cc: warning: -lelf: 'linker' input unused [-Wunused-command-line-argument]
conftest__.c:2:1: error: use of undeclared identifier 'Elf_Note'
Elf_Note _x;
^
1 error generated.
============
The failed code was:
int main(void) {
Elf_Note _x;
return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/err.h' file not found
#include <bsd/err.h>
         ^~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/err.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/libutil.h' file not found
#include <bsd/libutil.h>
         ^~~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/libutil.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/readpassphrase.h' file not found
#include <bsd/readpassphrase.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/readpassphrase.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/stdio.h' file not found
#include <bsd/stdio.h>
         ^~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/stdio.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/stdlib.h' file not found
#include <bsd/stdlib.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/stdlib.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/strlib.h' file not found
#include <bsd/strlib.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/strlib.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/string.h' file not found
#include <bsd/string.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/string.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/sys/cdefs.h' file not found
#include <bsd/sys/cdefs.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/sys/cdefs.h>
int main(void) {

return 0;
}
============
Failed: cc -g -O2 -c conftest__.c -o conftest__.o
conftest__.c:1:10: fatal error: 'bsd/unistd.h' file not found
#include <bsd/unistd.h>
         ^~~~~~~~~~~~~~
1 error generated.
============
The failed code was:
#include <bsd/unistd.h>
int main(void) {

return 0;
}
============
pkg-config --modversion atf-c : Package atf-c was not found in the pkg-config search path.
Perhaps you should add the directory containing `atf-c.pc'
to the PKG_CONFIG_PATH environment variable
Package 'atf-c', required by 'virtual:world', not found

@nabrog87: Unfortunately, I can't help you with your error. But I suspect that it is not the same error that has been discussed in this thread. The error message is different.