What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Diversion Diversion crashes every few days

cav45

New Around Here
I have been having this issues the last couple of months. Diversion works for a couple of days then stops working. I get a syntax error when i try to go into Diversion (see attached). The only way to get it working again is to uninstall Entware and reinstall. This issues has been frustrating.
 

Attachments

  • 1000010243.jpg
    1000010243.jpg
    45.7 KB · Views: 42
The screenshot you provided shows a syntax error ("unterminated quoted string") in the /diversion.conf file at line 44, which is likely causing Diversion to stop working after a few days. This error suggests the configuration file is corrupted, possibly due to an incomplete write. Use SSH to edit /diversion.conf and fix any missing quotes on line 44, such as a string that doesn’t have a closing ".
 
Post the output of:
Code:
grep adsCountLM /opt/share/diversion/.conf/diversion.conf
Something from your dnsmasq.log is likely breaking the variable’s quoting.
 
My knowledge of the command line is non existent. Is possible to point me towards a guide that might help edit the file. I cannot seem to open config file to start 😫 . Appreciate your reply and time.
 
Login with SSH and run the command I gave and copy/paste the output here. We don’t know what the problem is yet until we see that first.
adsCountLM='Apr 15 17:20:00 dnsmasq\[19464\]: reply LBP6000_LBP6018%20%40%20Linda's%20iMac._ipp._tcp.local is NXDOMAIN'

This is all that I got from using the above command. it seems to be pointing to a shared printer.

I am not new to Merlin routers but I am newbie when comes to scripts and advanced functions on the router. I appreciate your help and patience.
 
adsCountLM='Apr 15 17:20:00 dnsmasq\[19464\]: reply LBP6000_LBP6018%20%40%20Linda's%20iMac._ipp._tcp.local is NXDOMAIN'
It looks like the apostrophe in Linda's iMac is causing the problem. @thelonelycoder could add another "escape" for the apostrophe in the next Diversion update (if it's that easy to achieve). Perhaps for now, you can edit that file to have the line just read
Code:
adsCountLM=''
 
Last edited:
It looks like the apostrophe in Linda's iMac is causing the problem. @thelonelycoder could add another "escape" for the apostrophe in the next Diversion update (if it's that easy to achieve). Perhaps for now, you can edit that file to have the line just read
Code:
adsCountLM=''
Easier said than done. It would be MUCH simpler for @cav45 to rename "Linda's iMac" to "iMac Linda".
Saves me a lot of hassle with a function that has run the way it is for 7 years and counting.
 
@dave14305 Thank you. That bit of code seems to have resolved my issue. I can access diversion from amtm without the prior error. But did the name of the Mac have anything to do with it? It has has that name forever. The issue with Diversion started a couple of months ago. I have been using Diversion for years as well.

@thelonelycoder keep up the great work
 
Last edited:
The ads count function only runs once a day at 17 minutes past 8 pm and then grabs the last line in the Dnsmasq log file.
Maybe Linda hogs the Internet at around this time. I suggest to use Parental controls and limit access ;)
 
The ads count function only runs once a day at 17 minutes past 8 pm and then grabs the last line in the Dnsmasq log file.
Maybe Linda hogs the Internet at around this time. I suggest to use Parental controls and limit access ;)
My wifi ssid has the word Linda's in it as well. But why is this an issue now. It was running fine for so long.
 
My wifi ssid has the word Linda's in it as well. But why is this an issue now. It was running fine for so long.
It's random. Whatever happens to be the last DNS query in the log when diversion ad-counting runs gets selected as the "bookmark" for the next ad-counting.

If you want to avoid it completely, disable stats and logging in Diversion.
 
It looks like the apostrophe in Linda's iMac is causing the problem. @thelonelycoder could add another "escape" for the apostrophe in the next Diversion update (if it's that easy to achieve)...

Easier said than done. It would be MUCH simpler for @cav45 to rename "Linda's iMac" to "iMac Linda".
Saves me a lot of hassle with a function that has run the way it is for 7 years and counting.

Wouldn't it be easy to replace the single quotes with double quotes when enclosing the string assigned to the adsCountLM variable?

Diversion_write_config.jpg


If there's any chance that the string could also contain double-quotes, it's easy to escape those.
For example:
Diversion_ac_config.jpg


Or, is there some specific technical reason that the code must use single quotes to assign the variable?
I haven't looked closer at the rest of the code, so perhaps there's a reason for it.

Just my 2 cents.
 
Easier said than done. It would be MUCH simpler for @cav45 to rename "Linda's iMac" to "iMac Linda".
Saves me a lot of hassle with a function that has run the way it is for 7 years and counting.
I wish any important input field would strip special characters like these. It's such a bad practice to allow these. Or nulls. Found that out the hard way when people were naming their USB drives a null value, which subsequently became a required field name in AMTM when formatting a new drive.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Back
Top