Project

General

Profile

Actions

Bug #12031

closed

Wireguard Package Produces Crash in 2.5.2

Added by Kris Phillips almost 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Category:
WireGuard
Target version:
Start date:
06/12/2021
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
2.5.x
Affected Plus Version:
Affected Architecture:

Description

The Wireguard package produces a crash report in the dashboard in 2.5.2 after install. Here is the data:

Crash report begins. Anonymous machine information:

amd64
12.2-STABLE
FreeBSD 12.2-STABLE RELENG_2_5_2-n226652-8b3cd288327 pfSense

Crash report details:

PHP Errors:
[13-Jun-2021 00:16:55 Etc/UTC] PHP Warning: flock() expects parameter 1 to be resource, null given in /usr/local/pkg/wireguard/wg_service.inc on line 324
[13-Jun-2021 00:16:55 Etc/UTC] PHP Warning: fclose() expects parameter 1 to be resource, null given in /usr/local/pkg/wireguard/wg_service.inc on line 327
[13-Jun-2021 00:17:10 Etc/UTC] PHP Warning: flock() expects parameter 1 to be resource, null given in /usr/local/pkg/wireguard/wg_service.inc on line 324
[13-Jun-2021 00:17:10 Etc/UTC] PHP Warning: fclose() expects parameter 1 to be resource, null given in /usr/local/pkg/wireguard/wg_service.inc on line 327

Actions #1

Updated by Kris Phillips almost 3 years ago

Issue continues to be present in June 17th 2.5.2 RC build

Actions #2

Updated by Marcello Marques almost 3 years ago

Kris Phillips wrote:

Issue continues to be present in June 17th 2.5.2 RC build

It's already fixed in the latest version of package (v0.1.3), available at the author's site - try

pkg remove pfSense-pkg-WireGuard-0.1.1_1
pkg add https://github.com/theonemcdonald/pfSense-pkg-WireGuard/releases/download/v0.1.3/pfSense-pkg-WireGuard-0.1.3.txz
service wireguardd start

Also, a PR has been submitted by him to Netgate - if you don't want to mess with a manual install, it should be available at the official package repository soon.

Actions #3

Updated by Renato Botelho almost 3 years ago

  • Assignee set to Renato Botelho

I'll take care of this one

Actions #4

Updated by Marcello Marques almost 3 years ago

Renato Botelho wrote:

I'll take care of this one

FWIW, I've been running 0.1.2 (over several minor revisions) and 0.1.3 for many days now, with absolutely no issues - seems quite stable.

Actions #5

Updated by Christian McDonald almost 3 years ago

Hi all,

Yes this fix (along with a ton of other fixes) are in the current PR.

Actions #6

Updated by Marcello Marques almost 3 years ago

Christian McDonald wrote:

Hi all,

Yes this fix (along with a ton of other fixes) are in the current PR.

Your work on this is very much appreciated, Christian - if you ever find yourself in Santos, Brazil, the beers are on me!

Actions #7

Updated by Renato Botelho almost 3 years ago

  • Status changed from New to Feedback

WireGuard package version 1.1.3 was merged into 2.6.0 and 2.5.2

Actions #8

Updated by Alhusein Zawi almost 3 years ago

no crash report after installing WireGuard .

2.6.0.a.20210624.0100
WireGuard ver. 0.1.3

Actions #9

Updated by Kris Phillips almost 3 years ago

Checked on 2.5.2 June 26th build. The updated Wireguard package is not merged into the branch repo currently it would appear as the package available is still 0.1.1_1.

Actions #10

Updated by Kris Phillips almost 3 years ago

  • Status changed from Feedback to Assigned

Correction: Wireguard is available in the internal test repo. It is not available on the public-facing repo. I was able to get the current version installed on 2.5.2.

However, there is a new problem of hard crashing of the service now. It appears there is a kernel dependency in the latest build. Here is the logs:

Jun 26 20:23:40 php 2203 /usr/local/pkg/wireguard/wg_service.inc: The command '/sbin/kldload 'if_wg.ko'' returned exit code '1', the output was 'kldload: an error occurred while loading module if_wg.ko. Please check dmesg(8) for more details.'
Jun 26 20:23:40 kernel KLD if_wg.ko: depends on kernel - not available or version mismatch
Jun 26 20:23:40 kernel linker_load_file: /boot/modules/if_wg.ko - unsupported file type

Actions #11

Updated by Christian McDonald almost 3 years ago

I'm not seeing that on both my 2.5.2 and 2.6.0 boxes (both x86 obviously).

I have seen similar output from kld* when attempting to load a module for the incorrect architecture. Has something gotten crossed here?

Actions #12

Updated by Christian McDonald almost 3 years ago

Did some sleuthing into Kris's error. This looks like something wrong with the build, not something specific in the package code itself.

Ref: https://forums.freebsd.org/threads/kld-load-depends-on-kernel-not-avail-or-version-mismatch.57644/

Actions #13

Updated by Renato Botelho almost 3 years ago

Kris Phillips wrote:

Correction: Wireguard is available in the internal test repo. It is not available on the public-facing repo. I was able to get the current version installed on 2.5.2.

However, there is a new problem of hard crashing of the service now. It appears there is a kernel dependency in the latest build. Here is the logs:

Jun 26 20:23:40 php 2203 /usr/local/pkg/wireguard/wg_service.inc: The command '/sbin/kldload 'if_wg.ko'' returned exit code '1', the output was 'kldload: an error occurred while loading module if_wg.ko. Please check dmesg(8) for more details.'
Jun 26 20:23:40 kernel KLD if_wg.ko: depends on kernel - not available or version mismatch
Jun 26 20:23:40 kernel linker_load_file: /boot/modules/if_wg.ko - unsupported file type

I believe I know what is happening. Could you please force reinstallation of wireguard-kmod using `pkg install -f wireguard-kmod`, reboot, and check if fixes the problems?

Actions #14

Updated by Renato Botelho almost 3 years ago

  • Status changed from Assigned to Feedback
  • Target version set to 2.5.2
  • Affected Version set to 2.5.x

I've bumped package version so it is reinstalled during upgrade process. It was needed because we changed FreeBSD-src and all kmods must be rebuilt to match FreeBSD src

Actions #15

Updated by Christian McDonald almost 3 years ago

Looks good here, will we get this cherry picked for 21.05?

Actions #16

Updated by Kris Phillips almost 3 years ago

  • Status changed from Feedback to Resolved

Confirmed fixed in 2.5.2 latest builds on 0.1.3_1. Crash is no longer present.

Actions

Also available in: Atom PDF