You are not logged in.

#1 2018-09-24 3:56 pm

will_hough
Member
Registered: 2011-01-08
Posts: 3

Error with reporting to the Stop Forum Spam database

When I add my API key, I get this error when trying to report to SFS.

There was an error!
Error with reporting to the Stop Forum Spam database

Using this extension - https://www.phpbb.com/customise/db/extension/ban_hammer_2/

Offline

#2 2018-09-24 7:09 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

I see you all ready asked him, and he sent you here,

From: https://www.phpbb.com/customise/db/extension/ban_hammer_2/support/topic/196416
============
Re: Error with reporting to the Stop Forum Spam database
by RMcGirr83 » Sun Sep 23, 2018 9:58 pm

That would be an issue with stop forum spam just as the error states.

Probably the only person that can help you will be Pedigree, he will probably need some more details and request that you PM (Private Message) him,....

Pedigree is the only one that has access to who the API keys belong to and the logs that would show why you can not access. If you have full ssh access to the server you use, you should be able to also find logs that give some information on this.
If you have full ssh access to the server you use, you should be able to also find logs that give some information on this.
If you do not have full access to your server, IE: it is some hosting company, and many do not allow the customers the kind of access you need to trouble shoot this, the you should contact their support as well.
One thing that could cause this would be you or someone was making "bad submissions", and the API key was removed/blocked, but also, are you sure you have the correct API key in your settings,..
Pedigree is rather busy, so it may take some time for him to respond, so please just try to be patient. There also might be some other forum members with some ideas, but I think the only one that can get the info needed is Pedigree.
  Sorry I could not be of more help.

Offline

#3 2018-09-24 7:14 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

It just occurred to me now,  you can check or test your API key, try to submit some "spammer data" manually, use the same API key you have put in your "ban hammer extension", are you able to submit the data manually ?
If you can, then that indicates something is wrong in the way the extension is trying to make the connection.
==============
Other topics that may help:
https://www.stopforumspam.com/forum/vie … hp?id=5304
=======
Maybe will add more later
===edit===
Here is some older topics, where we were trouble shooting a similar problem, different extension but same author, etc. anyway hope it helps
you.
https://www.stopforumspam.com/forum/vie … 039#p48039

Offline

#4 2018-09-24 9:34 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Update:  I have 1 phpBB3 forum that is using  the "STOP FORUM SPAM
by "RMcGirr83" " extension, not exactly the same as the ban_hammer_2 extension, but similar , and I just now ran a test, get the same error as the OP,  but the data base and API seems to be working fine for other forums/software(plugin , mod , or extension).
For example on a fluxBB forum , it has submitted successfully  over the last few days.
These are the numbers:

2018-09-20	113	113	0
2018-09-21	86	86	0
2018-09-22	116	116	0
2018-09-23	109	109	0
2018-09-24	83	83 

To clarify, today 09-24 83 submissions have been made so far. If there was something wrong with the API, on our end it would not have been able to make those submissions.

  We have had problems before involving these extensions by RMcGirr83 not being able to connect to the data base using the API, and it does not help the way the author , just automatically blames us, something has changed, mine was working, now it isn't as well,..I am looking into it and will let you know what I find.
==== edit ====
I can submit using that API key, but manually, so I know the API key is valid, and working.  Before, when this type of problem came up,
Pedigree had made some changes , and they affected a very few , including some that were using the extensions by "RMcGirr83"
Another thing, I am just now remembering,  your hosting, and server, is it by any chance powered with CentOS ? If you don't know, please try to get that info, PM me with the hosting company, name, and what the server OS is, also is NGINX,Apache, or what ever other,...Please DO not post a link to your hosting service or website  here.
Has your hosting done any kind of upgrades/updates , recently ?
===== edited again ===
One other thing,
Is the spam you want to submit, in a "moderation queue "? or is it a older post that all ready was approved, ? I ran into this same error, if and when I try to submit a post that had been approved, it only submitted correctly when the post was still in the  "moderation queue "
I am rather busy myself, and have not yet had the chance to completely look at why mine is not submitting now,  I use CentOS, on that particular server, and if it shutdown, and rebooted, that is the problem for me, some of my settings would not have been saved when it rebooted,  and the solution will be to put those settings back in, but I just don't have the time for it right now.  CentOS can be rather problematic, and I regret having decided to use it for a server, but that would be another topic.
On the "post being approved", a example would be a old post, that the poster came back and edited it, adding spam to it,..You might have to just submit it manually, on mine that is what I would have to do, because the extension won't work on old posts,... hope all of this makes sense to you.

Offline

#5 2018-09-26 6:36 pm

JamesC
Member
Registered: 2010-01-09
Posts: 93
Website

Re: Error with reporting to the Stop Forum Spam database

Will,

Submit the data manually at this link: https://www.stopforumspam.com/add
(If you are logged into the forum, the API key will autopopulate for you. Otherwise, manually enter it.)

Once you have submitted the record that was rejected through Banhammer, pull it back up on this site and then give us a link to that submission.

I'm specifically looking at the character encoding of the data you are submitting here. This site requires all submissions to be in UTF-8; if your submission is encoded differently (for example, if áccéntéd or Japanese characters are allowed on your site), then SFS will reject the submission.

When you manually submit the data through the link above, your browser will convert it to UTF-8 if it isn't already. This helps us identify where the problem may be: if a manual submission works, the problem is definitely in the mod!

It is the mod author's responsibility to properly convert your data to UTF-8 before submitting, and I don't notice it in their code:

// banhammer version 1.0.8 > event > banhammer_listener.php, lines 334-349
if ($this->request->variable('sfs_report', 0) && !empty($this->config['bh_sfs_api_key']) && $curl_exists)
{
	// add the spammer to the SFS database
	$http_request = 'http://www.stopforumspam.com/add.php';
	$http_request .= '?username=' . $this->data['username'];
	$http_request .= '&ip_addr=' . $this->data['user_ip'];
	$http_request .= '&email=' . urlencode($this->data['user_email']);
	$http_request .= '&api_key=' . $this->config['bh_sfs_api_key'];

	$response = $this->get_file($http_request);

	if (!$response)
	{
		$error[] = $this->user->lang['ERROR_SFS'];
	}
}

Maybe any necessary conversion is done elsewhere in the mod, maybe it's done within phpBB before it ever goes into your database. All we can tell is that the author does not specifically convert it to UTF-8  immediately prior to submitting to Stop Forum Spam.

Also, double-check that your API key is entered into Banhammer correctly - leading or trailing spaces, or other unprintable characters, will cause your submissions to be rejected. Both of my API keys are 14 characters long, but count the length of yours (as it appears on your API Keys page) to be sure. smile

Last edited by JamesC (2018-09-26 6:48 pm)

Offline

#6 2018-09-26 6:43 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Hi James,
Can you stick around a few minuets, I do have the same problem, but with the other extension, and had not yet found the problem, I would like to submit something manually, now, it will just take a couple of minuets ?
=== edit===
Never mind , that wouldn't show anything since I would be submitting, from this computer, and not the server, but also I have tried with the
sfsdiag.php , from the server, and it does connect to the API ok.  submiting

Offline

#7 2018-09-26 6:47 pm

JamesC
Member
Registered: 2010-01-09
Posts: 93
Website

Re: Error with reporting to the Stop Forum Spam database

I can stick around til the top of the hour. smile

Offline

#8 2018-09-26 6:58 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Never mind , that wouldn't show anything since I would be submitting, from this computer, and not the server, but also I have tried with the
sfsdiag.php , from the server, and it does connect to the API ok. Here is what it shows:

 # some text removed==
allow_url_fopen = 1
attempting file_get_contents of sfs
file_get_contents for sfs returned string(109) " username no 0 " 
attemping file_get_contents of dyndns
file_get_contents for dyndns returned string(107) "Current IP Address: xxx.xxx.xxx.xx " 
testing curl
curl exists
testing sfs
init returned resource(5) of type (curl) 
curl_exec returned string(109) " username no 0 " 
testing dyndns
init returned resource(6) of type (curl) 
curl_exec returned string(107) "Current IP Address: xxx.xxxx.xxx "     

Offline

#9 2018-09-26 7:08 pm

JamesC
Member
Registered: 2010-01-09
Posts: 93
Website

Re: Error with reporting to the Stop Forum Spam database

Papa Parrot, I don't see anything unusual in the diagnostic results.

Could you take a look at the data you can't submit through your phpBB mod? If it has anything non-standard to English (such as Spanish, Norwegian, or Asian characters) then that could be the problem.

Worst case, pop over to my forum and post in my Central Perk area. That's out of Googlebot's visibility. wink

Offline

#10 2018-09-26 7:19 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Ok thanks, any way, that is what I thought, my self, "I don't see anything unusual in the diagnostic results", they looked ok, but actually that is only for checking the data base , and the API key is not used there, I am going to remove the data here though,...any way, I just now did make a manual submission, again, using the API key for that server, and it submits fine, also as I mentioned earlier in the thread, several other forums, but different software : fluxBB and a different mod, all are submitting spammers, and the data, just fine,... so I am pretty sure there is no problem with the API, here at SFS, it is something in the extension code, I am pretty sure,... any way thanks for your time just now.

Offline

#11 2018-09-26 7:34 pm

will_hough
Member
Registered: 2011-01-08
Posts: 3

Re: Error with reporting to the Stop Forum Spam database

Hello all. Sorry it's taking me a bit to get back here to check my post.

Once I get a spammer on the board again I will try to manually add and let you know what happens.

I do have SSH access

It does run on CentOS

Offline

#12 2018-09-26 8:03 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

I had been wondering, "Sorry it's taking me a bit to get back here to check my post.",

Also a apology, I made a mistake, when I said it was on the centOS server, I realized that when I was checking the settings, but anyway, those settings , if unset, would also effect the php programs, and access to the site, as well, not just the extension working.
Another factor, at least on mine, I noticed the phpBB3, is now saying it needs to be updated,

3.2.2 [ Re-Check version ]

It is now 3.2.3, I don't see how that would effect the extension though. And , I am still waiting to see if Pedigree has any ideas, he has not seen this yet.
  I get the impression you would all ready know, which logs to look at on your site, and this is something I have not yet done myself, for me it is not really very important, the site is not very active, in fact the only reason I installed the phpBB3, and the SFS extension was in a attempt at trying to duplicate similar problems, another member was having, I was never able to duplicate them, on mine it worked fine and I was able to submit/report spammers, at that time. It is possible Pedigree did make some changes here, that effect it, but he usually announces it when he makes that kind of change, and there have not been any recent announcements. 
  If you do find something, please also let us know, it is not really a matter of "whose fault", but I really don't think it is on this end, I don't particularly like phpBB, the older versions were not as bad, but the phpBB3, is very confusing to me, and hard to find what might be going wrong, I think it is kind of to bad that RMcGirr83 is so quick to blame us, not blaming him, but I did notice in his response, he did not sound like he even tried it , to see if he gets the same problem.  The error messages are misleading, they give the impression stopforum spam is down, etc, and that is not necessarily true. But I suppose that is kind of another topic.
 

Once I get a spammer on the board again I will try to manually add and let you know what happens.

Ok, thanks , as I mentioned, I don't have any problems submitting/report them manually, in fact I actually prefer that method, on the SFS extension, it only submits the user name, e-mail and IP, but not a copy of the actual spam as evidence, and manually I can include the actuall spam post, or part of it as evidence, which gives it more value in the data base.

Offline

#13 2018-09-26 9:14 pm

Alex Kemp
Moderator
From: Nottingham, England
Registered: 2009-12-02
Posts: 2,423
Website

Re: Error with reporting to the Stop Forum Spam database

JamesC wrote:

This site requires all submissions to be in UTF-8; if your submission is encoded differently (for example, if áccéntéd or Japanese characters are allowed on your site), then SFS will reject the submission.

That is incorrect info. The initial statement in the quote is correct, but the statement on the example for utf8 is wrong. Have a look at Wikipedia, which currently suggests 1,112,064 codes available in utf8/Unicode. With a little bit of thought you will realise that there are going to be an awful lot of “áccéntéd or Japanese characters” within that collection. In fact, utf8/Unicode attempts to provide a single text coding for every character within every human (and a couple non-human) languages. utf8 is a schema for encoding text characters and is, in itself, impartial as to the language of the text that is encoded.

Every modern Linux distro uses utf8 as the default character encoding. Thus, unless the server Locale has been changed from the default there will be zero need to recode the submission.

Offline

#14 2018-09-26 10:43 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Thanks Alex,
Also, I installed the ban hammer extension, and get the same error, when it "ban" the spammer,...

There was an error!
Error with reporting to the Stop Forum Spam database

How ever, the same as before if I submit the spammer manually, and still using the same API key, it submits fine.  I removed it though, because it is a test-user, however it is also my IP , so obviously I don't want to leave it in the data-base, honestly I think the only way to resolve this is for  RMcGirr83 and Pedigree, to run some tests, and see if they can determine why it is not working.
  Pedigree is the only one that has access to the logs, here, that would show the attempts at accessing, and possibly why.  RMcGirr83  should be familiar enough with his extension that maybe he could share what lines, in which file need to be changed so that it works... I still need to log at my logs, but I don't expect them to have what I am looking for, "been there , done that", before, in any event I will check them now.

Offline

#15 2018-09-26 11:33 pm

Alex Kemp
Moderator
From: Nottingham, England
Registered: 2009-12-02
Posts: 2,423
Website

Re: Error with reporting to the Stop Forum Spam database

Log in to your server command-line via SSH & make a submission to the SFS API. That will send all errors to STDOUT (do a "&2>1" if unsure, which will re-direct errors to the standard-out). If a submission that has already failed in the logs works at the server command-line than without doubt you can say that it is an error with the ban hammer extension. If you get an error then no need for logs as it will be in your face.

Offline

#16 2018-09-27 12:09 am

JamesC
Member
Registered: 2010-01-09
Posts: 93
Website

Re: Error with reporting to the Stop Forum Spam database

Alex, any phpBB 2/3 installation can deviate from the OS's default encoding, or deviate from phpBB's own default encoding. Just a quick Google and I find roughly 3 dozen posts regarding  charset deviations and how phpBB owners resolved the issue.

I don't run phpBB, but I have two vBulletin sites. My 11 year old forum is in latin1_swedish_ci, my less-than-a-year forum is UTF-8. I know I did not set an encoding preference when I installed the newer one, and a decade ago I had no need to select Swedish encoding for an American forum. The vBulletin installers set these without prompting me, and they work for me, so I have never changed them.

I am willing to entertain the possibility of Will's forum not being set to UTF-8. By saying "(for example, if áccéntéd or Japanese characters are allowed on your site)", I was hinting toward an intentional and deliberate change from phpBB's and/or the server's default encoding. Will or Papa Parrot would probably remember supporting Japanese characters a lot more readily than a setting they may not have touched since the initial installation however many weeks, months, or even years ago.

If encoding never deviated from defaults, pedigree would not have needed to say "Note: Username and Evidence fields must be converted to UTF-8 prior to submission. All fields must be urlencoded in order to preserve the correct details." on the API usage page. wink

I see no harm in investigating a potential encoding issue and then the potential urlencoding issue. Especially if our tests allow someone to go back to the original mod author and let them know what needs to be fixed, so this problem doesn't keep popping up. smile

Last edited by JamesC (2018-09-27 12:09 am)

Offline

#17 2018-09-27 12:59 am

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Alex, here I am now going to show how little I know :

Log in to your server command-line via SSH & make a submission to the SFS API.

All though I know how, and can log in via ssh, I do not know how I would make a submission from the CLI,  Can you show some code/command on this ? Thanks

ON this:

JamesC wrote:
This site requires all submissions to be in UTF-8; if your submission is encoded differently (for example, if áccéntéd or Japanese characters are allowed on your site), then SFS will reject the submission., -----and ----
I was hinting toward an intentional and deliberate change from phpBB's and/or the server's default encoding. Will or Papa Parrot would probably remember supporting Japanese characters---snip

No those settings have never been changed, and I am not using any additional/other settings, I don't know about Will though.

Offline

#18 2018-09-27 4:41 am

pedigree
uıɐbɐ ʎɐqǝ ɯoɹɟ pɹɐoqʎǝʞ ɐ buıʎnq ɹǝʌǝu ɯ,ı
From: New Zealand
Registered: 2008-04-16
Posts: 7,056

Re: Error with reporting to the Stop Forum Spam database

I might have to move everything to utf8mb4 but that seriously slows down MySQL.  Is anything that you're trying to submit include emojis?

Offline

#19 2018-09-27 12:35 pm

Alex Kemp
Moderator
From: Nottingham, England
Registered: 2009-12-02
Posts: 2,423
Website

Re: Error with reporting to the Stop Forum Spam database

Papa Parrot wrote:

I do not know how I would make a submission from the CLI

Some example code is on the API usage page. The basic usage is:

http://api.stopforumspam.org/api?\
username[]=spammer&\
email=w.a.spigi%2B25%40gmail.com&\
ip[]=1.2.3.4

Using WGET you can use the “-O” parameter to give an explicit name to a file to receive the SFS output.

The URL will need quoting + the ampersands (“&”) back-slashed to prevent interpretation by the bash shell. In addition, other characters (“!”, “@” are obvious examples) can give grief & that is normally handled by url-encoding.

Here is an example under Devuan from my home computer using parameters from my most recent submission:

wget -O output.txt \
> "http://api.stopforumspam.org/api?username=juanharring\&email=juanharring%2B25%40zoho.in\&ip=27.56.131.252"

Printing that to the screen then gives the same response as within a browser:

:~$ cat output.txt
<response success="true">
	<type>username</type>
	<appears>no</appears>
	<frequency>0</frequency>
	<type>email</type>
	<appears>yes</appears>
	<lastseen>2018-09-27 11:15:04</lastseen>
	<frequency>255</frequency>
	<type>ip</type>
	<appears>yes</appears>
	<lastseen>2018-09-08 13:04:33</lastseen>
	<frequency>7</frequency>

Offline

#20 2018-09-27 2:04 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Thanks Alex, I guess I should have mentioned, yes I tried with those examples and can connect and get  the response, as shown,
this would be good, if I was just checking to see if the entity was listed as a spammer, and how often (frequency).
And yes, no problem running that from the CLI, and getting a response.
But,  to actually submit data ? Obviously we would need to include our API key as well, the closest I can find on the "usage and examples" page is:

$ch = curl_init('https://www.stopforumspam.com/add');
if ($ch) {
  // if your curl version does not support SNI and you must use HTTPS then you may have to disable verify with 
  // curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt ($ch, CURLOPT_POST, 1);
  curl_setopt ($ch, CURLOPT_POSTFIELDS, "ip_addr=IPADDRESS&evidence=XXXXXXXXXX&email=EMAILADDRESS&api_key=ZZZZZZZZZZZZZZZ");
  curl_exec ($ch);
  curl_close ($ch);
}

But that is a php script, or part of one, and I could not figure out a way to run that from the cli, starting with the curl command, or other command as needed ? Hope that is more clear now.  Actually, if we have another example on this, maybe Pedigree can add it to the  usage page, but guess that is another topic.

Code examples

You can find examples of code, to access the API, on the API code examples page. Currently, there is PHP but we hope that more people will provide code in as many languages as possible

Thanks

Offline

#21 2018-09-27 3:52 pm

will_hough
Member
Registered: 2011-01-08
Posts: 3

Re: Error with reporting to the Stop Forum Spam database

I was able to submit data manually with no issue.

Offline

#22 2018-09-27 4:18 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Ok, thanks, so we know now that your API key is working, etc.

pedigree>I might have to move everything to utf8mb4 but that seriously slows down MySQL.  Is anything that you're trying to submit include emojis?

Me, no, nothing like that is in the submission,  it is plain text, utf8, and just a "test spam" as text in the evidence.
I don't think the extension is even really trying to connect,
How can we confirm, or not , that the extension actually tries to connect and submit the data, Does anyone know which logs would show that ?
The server is Linux as well, Debian 7,..

Offline

#23 2018-09-27 9:31 pm

sklerder
Member
Registered: 2012-10-11
Posts: 336
Website

Re: Error with reporting to the Stop Forum Spam database

Hi all !

How can we confirm, or not , that the extension actually tries to connect and submit the data, Does anyone know which logs would show that ?

If the request is a POST request, it will be difficult to have logs, as POST request shouldn't be logged (for confidentiality purposes, at least) ...
One way would be to try with a modified version of the script (while keeping a copy of the original one, of course) which would log wat is submitted to SFS ...
It's not the only way, it's the simplest I would try, but it implies to have minimal knowledge of the script language (PHP, I guess).

Offline

#24 2018-09-27 10:04 pm

Alex Kemp
Moderator
From: Nottingham, England
Registered: 2009-12-02
Posts: 2,423
Website

Re: Error with reporting to the Stop Forum Spam database

Example of adding data from the terminal:

In the example below I have essentially made it a one-liner. It would be possible to put a “NAME='username=bert';” line above the curl and then put “$NAME” instead of the username=user line in the curl command, etc..

:~$ curl \
> --data-urlencode username=bert \
> --data-urlencode email=me@user.com \
> --data-urlencode ip_addr=1.2.3.4 \
> --data-urlencode api_key=XXXXXXXXXXXXXX \
> http://www.stopforumspam.com/add.php
<p>data submitted successfully</p>

OK. Now I just need to delete that false entry (USA, apparently)…

Offline

#25 2018-09-27 10:10 pm

Papa Parrot
Member
From: Mexico
Registered: 2011-08-19
Posts: 1,826
Website

Re: Error with reporting to the Stop Forum Spam database

Thanks a bunch Alex, this may be of use to others as well in the future. I did find something in my logs, but it does not seem to really help as to why, but any way I sent Pedigree a PM with a copy of that part of the log.

Offline

Board footer

Powered by FluxBB

Close
Close