Notices not running


#1

PhantomBot Version: 2.4.1 (Revision: 6a2fb20d)
Control Panel Version 1.1
Java Version: 1.8.0_65-b17
OS Version: Linux
Browser and Version (for Panel Support): Chrome newest MacOSX
Stock PhantomBot: No (using custom Language scripts)

So I had set this bot up on my Mac last year, and recently updated it. I moved all the files I was told to and everything updated just fine.

Then I decided to dip my toes in the water more with Linux… specifically running the latest Raspbian on an early model B Raspberry Pi.

The whole setup was a breeze. I transferred the necessary botfiles from my Mac setup to the Pi’s setup as if I were updating the Pi, and everything seemed to work great. Found the Pi’s IP and got a control panel running on my iMac through the router and everything seemed to be in there, including all the custom commands and notices that I had previously set up… except the bot isn’t sending the notices now.

I searched the forums for ideas and followed the action that ScaniaTV suggested on this post -

I ran the “sudo chown -R botuser:botuser .” command as the bot user and got nothing.

It spit out this error -

Sorry, user donbot3000 is not allowed to execute ‘/bin chown -R donbot3000:donbot3000 .’ as root on Raspberrypi.

I’ll admit that I’m still new to all of this, but I followed the excellent documentation here in the forums and everything else is totally working right as far as I can tell. The bot is in my Discord and Twitch chats and responds to all the commands I’ve thrown its way. It’s just not spitting out the notices. HELP!! :smile:

Thank you!


#2

Just to sure, you have the notice module and toggle on? Also, that error means your bot isn’t part of the sudo users.


#3

Yes, the ./systems/noticeSystem.js is toggled on, as are both chat notices and offline chat notices in the notice panel. I wondered about that error, as I set everything up according to the Ubunto 16.04 Linux setup (various forum posts suggested that direction for Raspbian on the Raspberry Pi) and the instructions specifically have you set the bot up non-root -

3. Create a PhantomBot User:

IMPORTANT!
NEVER run this type of applications as root or root-user! Provide only necessary privileges to keep your server secure!

-from Ubuntu 16.04 LTS Setup Guide

Do I need to give root privilege to my bot? How would I do so? Or should I add that command to the sudoers file as I did with the Start/Stop/Restart systemctl commands like I did from section 5 of that page?

Thanks for the help! I’m good at following directions. SOME of this Linux stuff is starting to make a little sense, though! :smile:


#4

In my personal opinion, no account should have unfettered root access. It is too easy to accidentally run a command that one would regret later and makes it easier for any hacker to find more accounts that may allow them to gain root access.

This is part of the sudoers from my bot/build server:

iobot           ALL=NOPASSWD: /usr/sbin/service iobot start, /usr/sbin/service iobot stop, /usr/sbin/service iobot restart, /usr/bin/certbot renew
illusion        ALL=(builder) NOPASSWD: /home/builder/nightlyPBBuild.sh
ots             ALL=NOPASSWD: /usr/sbin/service onetimesecret start, /usr/sbin/service onetimesecret stop, /usr/sbin/service onetimesecret restart

You may even notice that illusion (me) can run a specific command as builder as needed.

Others may feel differently and prefer to give an account full root access, it is up to you.


#5

I tried adding the chown command to my sudoers file. Still no notices.

I wish I knew what I was doing wrong. Everything else is fine as far as I can tell. Just no notices.

Frustrating.


#6

Can you shoot over a screen shot of the configuration for notices? If nothing jumps out might ask for logs to ensure that there isn’t some sort of error occurring.

Also, adding chown to the sudoers just allows you to run the command, doesn’t run it (but I imagine you did run it - I am just saying this in case someone else reads the post looking for help). Typically, just becoming root and running the chown is groovy but, being able to run it on demand as the bot user makes sense too.


#7

Yes, I ran the command. :smile:

Here’s a screenshot of where it’s set. I’d usually have it at 10 minutes, but I put it for less while trying to test things. I’m suspecting you’ll need to check some logs or config files. I can run the bot with the same configuration files on my iMac and everything runs as planned. This is just happening with the bot running on the Pi.

Thanks for your help!


#8

Nothing jumps out at me for sure. If you have anything in the error or core-error logs that might be helpful. Not sure if anything of interest is going to the Console either.

If I find time I can test on a Raspberry Pi. At times we have seen an occasional interesting artifact due to the 32-bit architecture - for example backups weren’t working on Pi but on everything else.


#9

From my Pi:

[pomona] /opt/iobot
illusion% cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

PhantomBot Console:

[10-21-2018 @ 22:51:08.303 GMT] The working directory is: /opt/iobot
[10-21-2018 @ 22:51:08.304 GMT] Detected Java 1.8.0_144 running on Linux 4.9.24-v7+ (arm)
[10-21-2018 @ 22:51:08.317 GMT] 
[10-21-2018 @ 22:51:08.319 GMT] PhantomBot Version: 2.4.1
...
[10-21-2018 @ 16:57:29.583 MDT] [CHAT] Test Notice 1
[10-21-2018 @ 17:02:39.582 MDT] [CHAT] Test Notice 2

I could try to copy your notices and see if I can reproduce it, I just set this:


#10

My notices are:

Engage the one-armed-bandit with !slot and win TACOs! EAT 10 TACOs and maybe you’ll win!

Hear ‘‘The Don’’ live on the airwaves. Every Wednesday night from 9 to Midnite EST Listen - WUVT: Radio for Everyone! WUVT FM 90.7 Blacksburg, VA.

Type !8ball and your question, and consult with our dumb low-rent Magic 8-Ball that gets things wrong sometimes.

Join the Doncast Worldwide Industries Discord and chat with ‘‘The Don’’ ANY TIME!!! https://discord.gg/8hVYDTM

If that helps…


#11

There’s a converted link in notice 2… it got caught up in the markdown! :smile:


#12

So I guess I just need to start over? Everything but notices works, so I’ve done something right. At my wit’s end.


#13

Any ideas? I’m lost here. Should I just start from square one and assume I did something wrong? Everything works right except for the notices. I want the notices to work as they did on my Mac. It appears that IllusionaryOne can get this working on his Pi just fine. I’m just the amateur that follows directions well, but doesn’t know what he’s doing. Please advise. Thanks.


#14

I’ll note that one thing tells me to run “sudo chown -R botuser:botuser .” but the original setup I used had an * instead of the period at the end. This is how close I pay attention. I don’t know what any of that means, but I did exactly what the Linux setup told me to (since forum posts directed to do that for running Raspbian). This stuff is starting to make me feel crazy.


#15

Only thing I can think of, is deleting the notice table from the database, which removes all of your notices. Feel free to send me your DB, while the bot is off and I’ll delete the table.


#16

Thank you! Sending that via PM. I appreciate the help. Sorry if I’m seeming impatient… this thing is just making me feel a tad crazy!


#17

For giggles, can you try changing the required messages to 1 then typing on message in chat to see if a notice pops up? if it doesn’t work, I’ll edit your DB.


#18

I tried! Set the required messages to 1 and submitted. Typed a bunch of things in. My commands generated the usual responses. I won Tacos playing !slot. But no notices being pushed. I even deleted all the notices and re-submitted them all. Nothing.

I’m sure this is as much a quandary for you as it is for me.
¯_(ツ)_/¯

I guess (as they say) it is what it is! :wink:

Thanks for your patience with my semi-crazed self.


#19

And to be clear, I’m sure I tried that in my own trouble-shooting, but I did indeed just turn the bot back on and do all of that through the control panel and chat. :smile:


#20

Sent you the edited DB.