Skip to content
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

fix the mongodb install issues on 2.7.0 #328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DirectXMan12
Copy link

See also: #320 (comment), but TL;DR:

  • pfSense 2.7.0 forked off from FreeBSD 14.0-pre at some time N
  • FreeBSD 14.0-pre switched to OpenSSL 3.0 in base at some time N+1
  • we pull from FreeBSD:14:x "latest" here
  • thus "latest" expects OpenSSL 3.0, but we (pfSense) have a base with OpenSSL 1.x

Thus, mongodb from FreeBSD:14:x errors out with missing libssl.so.30 linking errors.

pfsense/FreeBSD-src@b077aed says that we're gonna get OpenSSL 3.0 eventually in pfSense, but for now, we can pull from FreeBSD:13:x if we see that bad combination of (abi, pfSense version).

Fixes #320

@DirectXMan12
Copy link
Author

@tong2x as per your request :-)

tried to make it a bit less hacky than it was when i originally ran it :-P

See also: unofficial-unifi#320 (comment),
but TL;DR:

- pfSense 2.7.0 forked off from FreeBSD 14.0-pre at some time N
- FreeBSD 14.0-pre switched to OpenSSL 3.0 in base at some time N+1
- we pull from `FreeBSD:14:x` "latest" here
- thus "latest" expects OpenSSL 3.0, but we (pfSense) have a base with
  OpenSSL 1.x

Thus, mongodb from FreeBSD:14:x errors out with missing `libssl.so.30`
linking errors.

pfsense/FreeBSD-src@b077aed
says that we're gonna get OpenSSL 3.0 *eventually* in pfSense, but for
now, we can pull from FreeBSD:13:x if we see that bad combination of
`(abi, pfSense version)`.
@dvdp
Copy link

dvdp commented Aug 8, 2023

Looks to me there is a bug on line 116 - dollar sign missing in front of FREEBSD_PACKAGE_URL, it should read:
base_url=${2:-$FREEBSD_PACKAGE_URL}
Without that dollar sign, e.g. the URL for png will be generated as:
FREEBSD_PACKAGE_URLAll/png-1.6.40.pkg
With the dollar sign it is generated as
https://pkg.freebsd.org/FreeBSD:14:amd64/latest/All/png-1.6.40.pkg
which is a lot better imho

@dvdp
Copy link

dvdp commented Aug 8, 2023

Well, looks like the current version of this script is a bit buggy - it did not install mongodb42 so I copied/pasted some of the commands until I got it installed correctly (from the FreeBSD 13 repositories). Mongo seems to be running now but I'm still getting 404 when opening the web app - when I start unifi.sh I get:
[2.7.0-RELEASE][[email protected]]/root: Exception in thread "launcher" java.lang.NullPointerException: Web context failed to initialize
at java.base/java.util.Objects.requireNonNull(Objects.java:235)
at com.ubnt.net.C.ÖÒ0000(Unknown Source)
at com.ubnt.net.C.Òo0000(Unknown Source)
at com.ubnt.service.ooOO.øÓ0000(Unknown Source)
at com.ubnt.ace.Launcher.Ó00000(Unknown Source)
at com.ubnt.ace.Launcher.main(Unknown Source)

@DirectXMan12
Copy link
Author

FREEBSD_PACKAGE_URL

whoops, thought i fixed it, i'll push something tonight to fix that

a bit buggy

hmm, do you know where it failed? i tried to de-hackify what i did on my machine, but i might've missed something

@Donkeykong307
Copy link

hmm, do you know where it failed? i tried to de-hackify what i did on my machine, but i might've missed something

Other than "FREEBSD_PACKAGE_URL", I only had to change python37 to python38 for it to install. I currently also get the same error as above though.

@Lucero7919
Copy link

FREEBSD_PACKAGE_URL

whoops, thought i fixed it, i'll push something tonight to fix that

a bit buggy

hmm, do you know where it failed? i tried to de-hackify what i did on my machine, but i might've missed something

Sorry for asking what is probably a relatively newb question. How would I install the script in your branch on my pfsense box? Using a curl command or similar?

@Lucero7919
Copy link

Well, looks like the current version of this script is a bit buggy - it did not install mongodb42 so I copied/pasted some of the commands until I got it installed correctly (from the FreeBSD 13 repositories). Mongo seems to be running now but I'm still getting 404 when opening the web app - when I start unifi.sh I get: [2.7.0-RELEASE][[email protected]]/root: Exception in thread "launcher" java.lang.NullPointerException: Web context failed to initialize at java.base/java.util.Objects.requireNonNull(Objects.java:235) at com.ubnt.net.C.ÖÒ0000(Unknown Source) at com.ubnt.net.C.Òo0000(Unknown Source) at com.ubnt.service.ooOO.øÓ0000(Unknown Source) at com.ubnt.ace.Launcher.Ó00000(Unknown Source) at com.ubnt.ace.Launcher.main(Unknown Source)

Same here. When running the script from branch, I am getting to this point before the hang, and nothing works (remove the folder location and try again, double script run to combat timeout, nothing :(

@tong2x
Copy link
Collaborator

tong2x commented Oct 7, 2023

fix for opnsense to use latest unifi 7.5.187
#326
please test on pfsense though pfsense has a different issue with ssl
just need tester maybe we could come up with alitle progress with each fix

@CodeJACKz
Copy link

Any advise for what the best way forward is with this? Scrap pfsense and go to opnsense? or wait for 2.7 to have the SSL stuff sorted and allow this to work again??

@rekcon
Copy link

rekcon commented Nov 15, 2023

I have verifed @DirectXMan12 idea to install the mongodb44 from FreeBSD:13:amd64 over the installed Unifi from beta, works on Pfsense 2.7.0.

However the script given, does not. It is pulling packagesite.pkg for FreeBSD:14:amd64 and checking for mongodb44 which does not exist there. It must first download https://pkg.freebsd.org/FreeBSD:13:amd64/latest/packagesite.pkg then extract it and search that packagesite.yaml for the package path.

These are the exact steps I took to do this manually, without the programmatic searching of packagesite.yaml:

  1. Install Unifi 8.0.4 from PR beta UniFi Network Application 8.6.3 #332
fetch -o - https://shorturl.at/pqsuG | sh -s
  1. Disable unifi service to make changes:
service unifi.sh disable
  1. Remove current FreeBSD:14 version of mongodb44:
/usr/sbin/pkg unlock mongodb44
/usr/sbin/pkg remove mongodb44
  1. Install FreeBSD:13:amd64 mongodb44:
/usr/sbin/pkg add -f "http://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/mongodb44-4.4.25.pkg"
  1. Start service:
service unifi.sh enable
service unifi.sh start

Wait 30 seconds for the service to start and it should work. Because this is force installing a package from a previous OS version.. YMMV. Also, I have no idea how to script this.

@vincenttermaat
Copy link

I have verifed @DirectXMan12 idea to install the mongodb44 from FreeBSD:13:amd64 over the installed Unifi from beta, works on Pfsense 2.7.0.

However the script given, does not. It is pulling packagesite.pkg for FreeBSD:14:amd64 and checking for mongodb44 which does not exist there. It must first download https://pkg.freebsd.org/FreeBSD:13:amd64/latest/packagesite.pkg then extract it and search that packagesite.yaml for the package path.

These are the exact steps I took to do this manually, without the programmatic searching of packagesite.yaml:

  1. Install Unifi 8.0.4 from PR beta UniFi Network Application 8.0.7 #332
fetch -o - https://shorturl.at/pqsuG | sh -s
  1. Disable unifi service to make changes:
service unifi.sh disable
  1. Remove current FreeBSD:14 version of mongodb44:
/usr/sbin/pkg unlock mongodb44
/usr/sbin/pkg remove mongodb44
  1. Install FreeBSD:13:amd64 mongodb44:
/usr/sbin/pkg add -f "http://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/mongodb44-4.4.25.pkg"
  1. Start service:
service unifi.sh enable
service unifi.sh start

Wait 30 seconds for the service to start and it should work. Because this is force installing a package from a previous OS version.. YMMV. Also, I have no idea how to script this.

Same here. I could not get it to install after upgrade Pfsense from 2.7.0 to 2.7.1 until I followed these steps.
Now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pfsense 2.7 working?
8 participants