Closed vblz closed 1 year ago
@vblz Can you reproduce the error consistently? Does it also happen when you deploy to a v6 server?
I manage to reproduce it consistently, it repdocues on both v5 and v6 servers.
# go version
go version go1.18.1 linux/amd64
# go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/v/.cache/go-build"
GOENV="/home/v/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/v/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/v/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/v/path/to/project/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1614194871=/tmp/go-build -gno-record-gcc-switches"
# cat /etc/*-release
DISTRIB_ID=Pop
DISTRIB_RELEASE=21.10
DISTRIB_CODENAME=impish
DISTRIB_DESCRIPTION="Pop!_OS 21.10"
NAME="Pop!_OS"
VERSION="21.10"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 21.10"
VERSION_ID="21.10"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=impish
UBUNTU_CODENAME=impish
LOGO=distributor-logo-pop-os
Mattermost test stand:
sudo docker run --name mattermost-preview -d --publish 8065:8065 mattermost/mattermost-preview
git clone --depth 1 https://github.com/mattermost/mattermost-plugin-starter-template com.example.my-plugin && cd com.example.my-plugin && GOFLAGS=-buildvcs=false make
dist/com.mattermost.plugin-starter-template-0.1.0.tar.gz
as a pluginThe plugin doesn't start with the error This plugin failed to start. Check your system logs for errors.
Logs:
{"timestamp":"2022-04-20 07:28:02.685 Z","level":"error","msg":"Unable to activate plugin","caller":"app/plugin.go:142","plugin_id":"com.mattermost.plugin-starter-template","error":"unable to start plugin: com.mattermost.plugin-starter-template: Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol."}
Remove all -trimpath
arguments from Makefile
and rebuild again
# sed -e "s/-trimpath //g" -i Makefile
# GOFLAGS=-buildvcs=false make
after that plugin starts working.
I found it during git bisect
, the commit plugin stops working is https://github.com/mattermost/mattermost-plugin-starter-template/commit/05c25c4c47d1780cbd0698da5ded65df9ff1fa85
Found another way to bypass the problem: disabling CGO.
CGO_ENABLED=0 GOFLAGS=-buildvcs=false make
builds working plugin without removing -trimpath
plugin.json
says"min_server_version": "5.37.0"
, but backend plugin requiresgithub.com/mattermost/mattermost-server/v6
.Plugin builded with current master has error deploying to v5.39.1: