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

Unable to compile #3

Open
W0olFy opened this issue Nov 11, 2019 · 15 comments
Open

Unable to compile #3

W0olFy opened this issue Nov 11, 2019 · 15 comments

Comments

@W0olFy
Copy link

W0olFy commented Nov 11, 2019

Hello! I'm trying to compile jitsi-prom-exporter using your README but without any success.

go version go1.13.4 linux/amd64

Error:

# exporter
./main.go:150:3: cannot use promoted field TransportConfiguration.Address in struct literal of type xmpp.Config
./main.go:152:3: unknown field 'Password' in struct literal of type xmpp.Config
./main.go:155:3: cannot use promoted field TransportConfiguration.TLSConfig in struct literal of type xmpp.Config
@njrl
Copy link

njrl commented Dec 30, 2019

hey,...
did you solved that problem ? having the same

@nosmicek
Copy link

nosmicek commented Jan 3, 2020

see my PR (#5), it should solve the compilation problem

@zwindler
Copy link

Hi,

I've got the same issue.

The PR doesn't solve the compilation problem either.

@icewarp
Copy link

icewarp commented Apr 15, 2020

@zwindler and what is the problem? just stating "i have a problem" doesn't help me to get any idea what is wrong at all..

so please, can u be more specific, can u at least paste the compilation error here? with steps u did, e.g. i cloned with this command, than i applied your patch with this command, then i invoked maven with this command and here is the error i got..
i can't help u with no information.. i did compile sucessfully yesterday with no modification to my patch, and guessing other people's problems is not my area of expertise ;)
p.s.: i'm not developer nor somehow related to active development of this exporter, i'm just using it and found a way how to go around some obstacles so i want to share them, because i think it might be usefull for others

@icewarp
Copy link

icewarp commented Apr 15, 2020

so my commands (in general):

git clone https://github.com/karrieretutor/jitsi-prom-exporter.git
cd jitsi-prom-exporter
git remote add nosmicek https://github.com/nosmicek/jitsi-prom-exporter
git fetch nosmicek
git checkout -b patchx nosmicek/patch-1
git checkout master
git merge patchx
docker build . -t jitsi-prometheus-exporter:latest

voilá, docker image build..

@zwindler
Copy link

@icewarp I understand. If I write "I've got the same issue" it means "I've got the same issue".

I fail to see how copy pasting the EXACT same error message than the initial poster will help in any way, but fair, I'll post it.

@nosmicek
Copy link

@zwindler and did u apply the aforementioned patch (see pull request, #5 ) and compiled modified code than?

@zwindler
Copy link

As requested, my procedure (including steps not given in the README.md that I had to find out by myself)

Find the jisti-meet-cfg.lua

locate cfg.lua
/etc/prosody/conf.d/your.domain.tld.cfg.lua

Guess the "auth-domain", in my example I think this is auth.your.domain.tld. Laucnh the prosodyctl command given in the README.md

prosodyctl --config /etc/prosody/conf.d/your.domain.tld.cfg.lua register exporter auth.your.domain.tld myawesomepassword

Install prerequisites (nothing mentionned in the README.md)

sudo apt update
sudo apt install software-properties-common

sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go git

Get and compile the sources. Again, some guessing to do, as this step is only describe as "Clone this repo into your $GOPATH/src/ directory. In the exporter directroy run go get ./... which creates the exporter binary in $GOPTAH/bin/."

su - jvb
mkdir -p go/src && mkdir -p go/bin
cd go/src
git clone https://github.com/karrieretutor/jitsi-prom-exporter
cd jitsi-prom-exporter/
go get ./...

The error

# jitsi-prom-exporter.ori/exporter
exporter/main.go:150:3: cannot use promoted field TransportConfiguration.Address in struct literal of type xmpp.Config
exporter/main.go:152:3: unknown field 'Password' in struct literal of type xmpp.Config
exporter/main.go:155:3: cannot use promoted field TransportConfiguration.TLSConfig in struct literal of type xmpp.Config
exporter/main.go:264:31: not enough arguments in call to xmpp.NewClient
	have (xmpp.Config, *xmpp.Router)
	want (*xmpp.Config, *xmpp.Router, func(error))

@zwindler
Copy link

@nosmicek my bad. I thought I had tried your PR but I wasn't in fact in the good branch (in master, not patch-1 from the PR)...

git clone https://github.com/nosmicek/jitsi-prom-exporter.git
cd jitsi-prom-exporter
git checkout patch-1
git branch
  master
* patch-1
go get ./...

So it seems to compile with the PR. Sorry for saying otherwise. Now I have to find out how to run it

@raj2569
Copy link

raj2569 commented Apr 16, 2020

git fetch origin pull/5/head:pr-5
git checkout pr-5
go get ./...

and successfully compiled. go version go1.14.2 linux/amd64

@zwindler
Copy link

zwindler commented Apr 16, 2020

OK... so after doing some digging and a lot of trial and error I finally managed to run it...

The binary doesn't have any help nor flags so you have to configure ALL the environment variables cited in the doc. And the PR changes some of those so I lost a little time there as well.

In order to avoid anyone to lose time like I did, the correct procedure, in addition to those from my previous comments (to compile it)

cd go/bin
export PROMEXP_AUTH_USER=exporter
export PROMEXP_AUTH_PASSWORD=myawesomepassword
export XMPP_SERVER=127.0.0.1
export XMPP_AUTH_DOMAIN=auth.jitsi.domain.tld
export XMPP_INTERNAL_MUC_DOMAIN=internal.auth.jitsi.domain.tld
export JVB_BREWERY_MUC=JvbBrewery
./exporter

exporter and myawesomepassword being the login/password previously set with prosodyctl.

XMPP_SERVER is the address the XMPP server is listening on. 127.0.0.1 is a pretty safe bet but check with ss.

As I said previously, XMPP_AUTH_DOMAIN can be found in /etc/prosody/conf.d/your.domain.tld.cfg.lua

And for XMPP_INTERNAL_MUC_DOMAIN and JVB_BREWERY_MUC, they can be found in /etc/jitsi/videobridge/sip-communicator.properties by splitting the following variable around the "@"

org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.jitsi.domain.tld

Fun fact, I haven't found a way to specify which port the exporter listens to, making it by default listening to the 8080 port which is incompatible with my own setup.

I'm using another exporter (jitsiexporter) now.

@nosmicek
Copy link

@zwindler so you are basically saying, that u didn't read any documentation, tried by trial and error, than finaly read the documentation and made it work.. well, congratulations! :D
i'm curious because it seems that u don't have any idea about jitsi and its configuration (this exporter uses all the standard jitsi configuration variables and jitsi way how to do the configuration), how did u came here? i don't mean to be rude, but well.. being surprised by basic things..

@zwindler
Copy link

zwindler commented Apr 17, 2020 via email

@msalmasi
Copy link

msalmasi commented May 3, 2020

@nosmicek Thanks for the fix, you are awesome!

@zwindler Thanks for letting us know how you got it working, you are the documentation now XD

@nosmicek
Copy link

nosmicek commented May 3, 2020

@msalmasi u r welcome..

for the rest of ppl, so as not to be mistaken like @zwindler..

this piece of software is mainly meant to run in docker, that goes for the configuration via env variables.. it's not specifically written anywhere, but when there is ONLY one paragraph stating DOCKER container, and then configuration, i thought (and author probably too), that it is enough to hint you of meant usage.
Yes, port is hardcoded and it is mentioned in documentation, but that is just one line in file, you can easily change it, no special skill needed..
Yes, my patch makes changes to some env vars, so please read documentation after merging, or commit messages that state all made changes. My patch also clears some of the configuration setup burden, you can avoid some trial&error rounds ;)

@zwindler ok, we have different view on this, you are not developer, so please don't expect real developers to act like u wish, good luck
(end of flame war, if u want to continue this philosophical debate, then via email or other means, not via github)

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

No branches or pull requests

7 participants