Bug 219330 - sysutils/bsdstats: BSDstats failed: token enabling request failed
Summary: sysutils/bsdstats: BSDstats failed: token enabling request failed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-16 12:12 UTC by Gian-Simon Purkert
Modified: 2018-01-07 14:35 UTC (History)
11 users (show)

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments
bsdstats input logfile (1.93 KB, text/x-log)
2017-09-24 00:01 UTC, preason
no flags Details
bsdstats output logfile (1.43 KB, text/x-log)
2017-09-24 00:02 UTC, preason
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gian-Simon Purkert 2017-05-16 12:12:41 UTC
Installed bsdstats from port, but when i use bsdstats-send this error comes up:

BSDstats failed: token enabling request failed

Port 443 is open for in and out
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2017-05-16 15:12:29 UTC
Could you please change DO_LOG_NET_TRAFFIC=0 to DO_LOG_NET_TRAFFIC=1 in /usr/local/etc/periodic/monthly/300.statistics and attach /tmp/bsdstats.in.log and /tmp/bsdstats.in.log files?
Comment 2 Gian-Simon Purkert 2017-05-17 09:12:22 UTC
#########/tmp/bsdstats.out.log################

--Wed May 17 11:10:05 CEST 2017--
HEAD / HTTP/1.0
Host: rpt.bsdstats.org
User-Agent: bsdstats-6.0
Connection: close


--Wed May 17 11:10:06 CEST 2017--
GET /scripts/enable_token.php?key=07cceb6c5841f6990074101aa2d8913c&token=M3R3HovEJsVpZR92ULQKTS2c9zfxnrUl%2fevWSZzvZuA%3d HTTP/1.0
Host: rpt.bsdstats.org
User-Agent: bsdstats-6.0
Connection: close

#########/tmp/bsdstats.in.log ################

--Wed May 17 11:10:05 CEST 2017--
HTTP/1.1 302 Found
Date: Wed, 17 May 2017 09:10:05 GMT
Server: Apache/2.4.25 (FreeBSD) PHP/7.0.17
X-Powered-By: PHP/7.0.17
Location: http://www.bsdstats.org
Vary: User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8

--Wed May 17 11:10:06 CEST 2017--
HTTP/1.1 200 OK
Date: Wed, 17 May 2017 09:10:06 GMT
Server: Apache/2.4.25 (FreeBSD) PHP/7.0.17
X-Powered-By: PHP/7.0.17
Vary: User-Agent
Content-Length: 12
Connection: close
Content-Type: text/html; charset=UTF-8

STATUS=FAIL
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2017-05-17 15:57:24 UTC
Your key fails on the server for some reason. I notified the server maintainer.
In the meantime you can try to delete your key /var/db/bsdstats, and run again.
This will regenerate the key that might work fine.
Comment 4 Gian-Simon Purkert 2017-05-17 16:36:43 UTC
Well its not just this machine, i have 3 instances and all fail. But i think its a server problem.

Thanks for your help and for inform the server maintainers
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2017-05-17 16:38:15 UTC
You are welcome!

Let's see what the maintainers say.

Yuri
Comment 6 Sam 2017-07-26 08:42:54 UTC
I am experiencing same issue on freshly installed 11.1-RELEASE.

I also tried to remove key: 

# sudo rm /var/db/bsdstats                                                                         

Still gets same error:

# sudo bsdstats-send

BSDstats runs on this system for the first time, generating registration ID
BSDstats failed: token enabling request failed
Comment 7 Yuri Victorovich freebsd_committer freebsd_triage 2017-07-27 03:44:22 UTC
What is the version of BSDstats that fails for you?

Yuri
Comment 8 Sam 2017-07-27 06:36:11 UTC
I am tracking the "latest" pkg repository, bsdstats is version 6.0, running from a workstation install (HP Z620).

Same version runs fine from our servers. I cannot figure it out why it throws error from workstation.



This morning the error message changed:

# sudo bsdstats-send                                                                               

Posting OS statistics to rpt.bsdstats.org ... BSDstats failed: OS statistics submission request failed



I tried again to remove key: 

# sudo rm /var/db/bsdstats                                                                         

Still shows same error.



Thank you for your help!
Comment 9 Gian-Simon Purkert 2017-07-31 12:46:54 UTC
No news from the BSDstats-Owner? Website is pretty slow (maybe timeout)
Comment 10 preason 2017-09-24 00:01:36 UTC
Created attachment 186649 [details]
bsdstats input logfile

/tmp/bsdstats.in.log
Comment 11 preason 2017-09-24 00:02:27 UTC
Created attachment 186650 [details]
bsdstats output logfile

/tmp/bsdstats.out.log
Comment 12 preason 2017-09-24 00:07:54 UTC
I have the same error on an updated system of TrueOS; 12.0-CURRENT branch.

I have deleted /var/db/bsdstats as recommeded above, but the error still persists. Attached are the bsdstats.{in,out}.log files captured after modifying the change in /usr/local/etc/periodic/monthly/300.statistics for DO_LOG_NET_TRAFFIC=0 to DO_LOG_NET_TRAFFIC=1

Thank you.
Comment 13 vali gholami 2017-11-26 20:54:05 UTC
MARKED AS SPAM
Comment 14 Federico 2017-12-01 10:56:25 UTC
Same issue from a server with FreeBSD 11.0 and from other with freshly installed FreeBSD 11.1.

Tried deleting /var/db/bsdstats. A new key/token pair is generated but same error ("STATUS=FAIL").

I didn't attach traffic log because is almost the same as other people posted here.

I'm using package bsdstats-6.0_2.
Comment 15 Volodymyr(UA) 2018-01-04 20:33:20 UTC
Hello everybody!
I got on a similar error: "Posting OS statistic to rpt.bsdstats.org ... BSDstats failed: OS statistics submission request failed."

The reinstallation of the port did not help. But something prevents him from sending / verifying. I decided to see where the host ID is located, assigned at the first sending of statistics: /var/db/bsdstats
It turned out that after deleting the port, the file remains in the system. After manually deleting the file and a new installation of the port, it all worked.
Maybe this information be is useful to somebody.
Comment 16 Yuri Victorovich freebsd_committer freebsd_triage 2018-01-04 20:40:36 UTC
(In reply to Volodymyr(UA) from comment #15)

> It turned out that after deleting the port, the file remains in the system. After manually deleting the file and a new installation of the port

Yes, the file stays in the system during uninstall/reinstall.
Otherwise, your account on the server will change every time.

The problem is related to the server rejecting previously generated IDs.
Comment 17 Volodymyr(UA) 2018-01-04 20:58:24 UTC
(In reply to Yuri Victorovich from comment #16)
And what's the problem? Just get a new ID, the main thing is that the statistics was sent. Probably, there will be no problems with the new identifier.
For a new master this is not a matter of principle.
Comment 18 Yuri Victorovich freebsd_committer freebsd_triage 2018-01-04 21:03:39 UTC
(In reply to Volodymyr(UA) from comment #17)

It was designed to keep an account. When it counts, it counts for 30-60 extra days or so, because it is normally run monthly. If to delete and recreate account routinely, there will be double-counting. So it is good as a workaround, but not as a normal workflow.

Cheers!
Yuri
Comment 19 Volodymyr(UA) 2018-01-04 21:34:56 UTC
(In reply to Yuri Victorovich from comment #18)

If the problem with the identifier is constant, this is undeniable.
As far as I understand, you have already tried to change the ID and the problem was repeated.
In that case, I will not help you, my knowledge is not enough.
Excuse for troubling.
Comment 20 Yuri Victorovich freebsd_committer freebsd_triage 2018-01-04 21:36:03 UTC
(In reply to Volodymyr(UA) from comment #19)

No troubling at all. Thanks for trying to help!

Yuri
Comment 21 Yuri Victorovich freebsd_committer freebsd_triage 2018-01-04 21:37:11 UTC
@scrappy Marc, could you please look again if you could. The problem appears to be on your side.
Comment 22 Terry Kennedy 2018-01-04 22:06:27 UTC
To repeat, bsdstats SIMPLY DOES NOT WORK. Period. I realize that since you are the port maintainer, this is the equivalent of saying "wow, that's an ugly baby". But the reality is that it does not work for at least a large subset of users and has not worked for well over 2 years.

Here is an install on a freshly-installed 11-STABLE system:

Installing bsdstats-6.0_2...
Would you like to run BSDstats now [yes]? y
BSDstats runs on this system for the first time, generating registration ID
Posting OS statistics to rpt.bsdstats.org ... BSDstats failed: OS statistics submission request failed

This is the key/token pair that was generated:

(0:13) pool12:/var/db# more bsdstats 
# This file was auto-generated on Thu Jan  4 16:41:56 EST 2018,
# and contains the BSDstats registration credentials
KEY='2e81ebf5ee6eb382b7009b5a7330baf0'
TOKEN='31q7DmS0IsKdR4oyTQ5Yh6SvFS73dQPOBqWYEKpcUsk='
VERSION=6.0

And as I have mentioned elswhere, the http://bsdstats.org is also broken in a number of ways:

https://forums.freebsd.org/threads/55647/

For example, clicking on "Ports" returns the text "Category 1" (in invalid HTML) as the only data.

This would be a useful tool if it worked. In the condition it is in, however, it only serves to frustrate FreeBSD users who are trying to submit stats, and gives vendors and others who are considering adding FreeBSD support to their software an unrealistically small and erroneous view of the FreeBSD ecosystem. I ran into a first-hand example of this when I was working to convince a 3rd-party software company to add a FreeBSD version of their software - they said "we have more paying Linux customers for our software than the total number of FreeBSD systems listed on bsdstats". I also believe this was part of the reason a different 3rd-party software company dropped FreeBSD support a year or two ago.

IMHO, the port should be removed _and_ the bsdstats.org web page replaced with an "under construction" placeholder until / if both the port and the web site function reliably.
Comment 23 Yuri Victorovich freebsd_committer freebsd_triage 2018-01-04 22:09:57 UTC
(In reply to Terry Kennedy from comment #22)

I am only a maintainer of the port itself. I verified it several times, and confirmed that there is nothing wrong with the port.

This is the server problem. The server is maintained and owned by Marc (scrappy@FreeBSD.org).
Comment 24 Terry Kennedy 2018-01-04 22:32:45 UTC
(In reply to Yuri Victorovich from comment #23)

Who has been on the CC list for this bug since you added him in May, 2017 and again at a different address in July, 2017.

As the famous Wendy's commercial said, "I don't think there's anybody back there".

If the server that the port sends its data to isn't working, there doesn't seem to be any reason to have this port in active status. Perhaps retire it and it can come back when the server infrastructure starts working again?
Comment 25 Yuri Victorovich freebsd_committer freebsd_triage 2018-01-04 23:37:33 UTC
(In reply to Terry Kennedy from comment #24)

Could you please e-mail Marc at scrappy@hub.org? He is the one who manages the server. He will troubleshoot the problem if you help with user-side input. Because I never see this problem myself.

Yuri
Comment 26 Yuri Victorovich freebsd_committer freebsd_triage 2018-01-04 23:39:02 UTC
(In reply to Yuri Victorovich from comment #25)

Marc says that he figured this problem out, and now it is supposed to work if you try again.

Yuri
Comment 27 Terry Kennedy 2018-01-04 23:51:27 UTC
(In reply to Yuri Victorovich from comment #26)

Yes, it does now seem to be working, both for new installs and for an older one from 2017.

And the ports data seems to be filling in as well - the usage count for a port was at 1 when I first looked, and then went to 2, 3, 4 as I refreshed. So I think it has been broken for everyone (at least everyone submitting ports information) until just now.

Thanks for getting this fixed.
Comment 28 Terry Kennedy 2018-01-06 00:29:05 UTC
(In reply to Terry Kennedy from comment #27)

That didn't last long - it is now broken again (in a new and not-exciting way):

(0:1) test:~terry# /usr/local/bin/bsdstats-send
BSDstats runs on this system for the first time, generating registration ID
Posting OS statistics to rpt.bsdstats.org ... SUCCESS
Posting device statistics to rpt.bsdstats.org ... BSDstats failed: HTTP query failed during system devices submission
Comment 29 Yuri Victorovich freebsd_committer freebsd_triage 2018-01-06 01:42:08 UTC
(In reply to Terry Kennedy from comment #28)

The server maintainer says that this is now fixed.
Comment 30 scrappy 2018-01-06 02:23:02 UTC
(In reply to Yuri Victorovich from comment #29)

Sorry that I've been quiet ... 

The last bug wasn't so much a bug as it was Apache 2.4's limit on GET URL size ... I just doubled it, which, at least on my test server ( I was able to reproduce the bug ) fixes it ... let me know if it continues though ...

I'm going to look into possibly changing this to a POST method instead of GET, since I'm kinda surprised that Port Submissions haven't been failing earlier then this ...
Comment 31 Gian-Simon Purkert 2018-01-07 14:35:09 UTC
It works on all Machines, i think we can close the Bugreport.

Thanks allot for everyone solving it.