Advertisement:

Author Topic: "Undefined offset" errors  (Read 591 times)

Offline m4z

  • Jr. Member
  • **
  • Posts: 266
  • Localization Team Apprentice
"Undefined offset" errors
« on: April 11, 2019, 04:32:09 AM »
I'm seeing various "8: Undefined offset: [12]" errors in ManageSmileys.php and Themes.php in a fresh 2.1rc2 install (Debian 8, Postgresql 9.4):

  • Type of error: Undefined
  • 8: Undefined offset: 1
  • hXXps://redacted/~beta-smf/index.php?action=admin;area=smileys;sa=settings;[hexstring]
  • /home/beta-smf/public_html/Sources/ManageSmileys.php (Line 129)

  • Type of error: Undefined
  • 8: Undefined offset: 1
  • hXXps://redacted/~beta-smf/index.php?action=admin;area=smileys;sa=modifyset;set=1
  • /home/beta-smf/public_html/Sources/ManageSmileys.php (Line 303)

  • Type of error: Undefined
  • 8: Undefined offset: 1
  • hXXps://redacted/~beta-smf/index.php?action=admin;area=smileys;sa=modifyset;set=1
  • /home/beta-smf/public_html/Sources/ManageSmileys.php (Line 547)

  • Type of error: Undefined
  • 8: Undefined offset: 2
  • hXXps://redacted/~beta-smf/index.php?action=admin;area=theme;sa=list;th=1
  • /home/beta-smf/public_html/Sources/Themes.php (Line 664)

BTW, is there a way to permanently "ignore" specific errors?
"Faith is what you have in things that don't exist."
--Homer Simpson

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,629
    • StoryBB/StoryBB on GitHub
Re: "Undefined offset" errors
« Reply #1 on: April 11, 2019, 04:58:21 AM »
No, because they should be solved rather than ignored.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline m4z

  • Jr. Member
  • **
  • Posts: 266
  • Localization Team Apprentice
Re: "Undefined offset" errors
« Reply #2 on: April 11, 2019, 05:31:43 AM »
I assumed as much, and from a developer perspective I totally agree.
But from the user (admin) perspective it's kind of tedious to manually delete dozens of duplicate errors that I have already reported upstream.  :-X
"Faith is what you have in things that don't exist."
--Homer Simpson

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,629
    • StoryBB/StoryBB on GitHub
Re: "Undefined offset" errors
« Reply #3 on: April 11, 2019, 05:35:00 AM »
Yes but if you ignore them, you have to track that and evaluate that which will take more effort and storage than just dealing with it. Also you’d have no way of knowing if it was fixed.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline m4z

  • Jr. Member
  • **
  • Posts: 266
  • Localization Team Apprentice
Re: "Undefined offset" errors
« Reply #4 on: April 11, 2019, 05:48:01 AM »
I don't speak PHP (well), so I can't "deal with it" on a code level anyway. From my perspective, my current error log workflow is as follows:
  • delete 95% duplicates that I have already reported, so I can even find the "unhandled" errors
  • report new errors upstream and wait to be notified of a fix

I would prefer to be able to skip the first step by ignoring/filtering the duplicates, or at least an option to group/collapse/summarize repeated errors.

(I assume a huge part of my problem is that I'm using a RC version; I haven't used anything else than 2.1rc2 and hope the situation is much better on released versions.)
"Faith is what you have in things that don't exist."
--Homer Simpson

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,629
    • StoryBB/StoryBB on GitHub
Re: "Undefined offset" errors
« Reply #5 on: April 11, 2019, 05:53:43 AM »
The problem is that you have to work out what the ones you’ve seen are, so you have to log them somewhere and every error that comes up, you have to check if you already saw it, which is very quickly a performance drag.

And the minute you install any mod, or perform any change, the entire ignore list is probably invalid anyway.

And yes, the released situation is better though various addons can cause errors too.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: "Undefined offset" errors
« Reply #6 on: April 11, 2019, 04:33:17 PM »
Can you run this query in pgadmin

Code: [Select]
SELECT * FROM smf_settings WHERE variable LIKE 'smiley_sets_%'
The newline character might not be encoded in smiley_sets_names
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline m4z

  • Jr. Member
  • **
  • Posts: 266
  • Localization Team Apprentice
Re: "Undefined offset" errors
« Reply #7 on: April 12, 2019, 03:49:52 AM »
Code: [Select]
> select * from betasmf_settings where variable like 'smiley_sets_%';
      variable       |            value
---------------------+-----------------------------
 smiley_sets_known   | fugue,alienine
 smiley_sets_names   | Fugue's Set\nAlienine's Set
 smiley_sets_default | fugue
(3 rows)

Can't tell if this is how it's supposed to be though.
"Faith is what you have in things that don't exist."
--Homer Simpson

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Online albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 589
Re: "Undefined offset" errors
« Reply #9 on: April 12, 2019, 06:32:42 PM »
To test this for you you could run this query:

Code: [Select]
update betasmf_settings set value = 'Fugue''s Set'||E'\n'||'Alienine''s Set' where variable = 'smiley_sets_names'

Offline m4z

  • Jr. Member
  • **
  • Posts: 266
  • Localization Team Apprentice
Re: "Undefined offset" errors
« Reply #10 on: April 12, 2019, 07:20:26 PM »
Thanks, I should have reloaded the thread earlier: I didn't see your last post, but I finally figured it out myself in a similar way:
Code: [Select]
beta-smf=> update betasmf_settings set value='Fugue''s Set'||chr(10)||'Alienine''s Set' where variable='smiley_sets_names';
UPDATE 1
beta-smf=> select * from betasmf_settings where variable = 'smiley_sets_names';
     variable      |     value
-------------------+----------------
 smiley_sets_names | Fugue's Set   +
                   | Alienine's Set
(1 row)

beta-smf=>
"Faith is what you have in things that don't exist."
--Homer Simpson