Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Slaps on September 27, 2023, 11:30:56 AM

Title: JSON decode error: The maximum stack depth has been exceeded
Post by: Slaps on September 27, 2023, 11:30:56 AM
Quote from: Chyandour on April 30, 2023, 05:25:17 AMHi,

I have started to get the following in the error log.

Screenshot 2023-04-30 at 10-19-15 Error Log.png




Same problem here. The cause it's seems to be some users, always the same.

Any ideas as to what's gone wrong?




Quote from: Kindred on April 30, 2023, 08:57:40 AMSmf version?
Mods installed?
Php, mysql version?

Smf 2.1.4

Many:

1   Forum Width Setting   1.2   
2   TinyPortal   2.2.2   
3   Pretty URLs   2.5.1c   
4   Ultimate Menu   2.0.2   
5   Ad Management   3.5d   
6   Video Embed   1.0   
7   FancyBox 4 SMF   1.1.1
8   Google Analytics Code   1.6   
9   Optimus   2.10.5 [12.04.22]   
10   TopicRenamer   2.2   
11   SoundCloud Embed Widget   1.3   
12   Simple Audio Video Embedder   7.0   
13   SMF 2.1.4 Update   1.0   
14   Alternate User Posting   2.1.2   
15   Track IP on ip-adress.com   1.2   
16   SMF 2.1.3 Update   1.0
17   Message Bookmarks   0.9.1


Php version and MySQL version I have to check ..
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: Kindred on September 27, 2023, 11:45:18 AM
Please don't piggyback on another support thread.

Please include YOUR specific error (unless you have exactly the same setup, I'm betting that the details are not identical to the one you quoted)
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: Slaps on September 27, 2023, 12:34:49 PM
Oh, ok. Sorry.  :'(
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: Slaps on September 27, 2023, 01:44:44 PM
Hi there,
I have started to get the following in the error log, with some users, always the same.

Username
User IP
150d4bf9597255f8de8cb75ed76164ab
https://forum.jamble.it/index.php?action=profile;area=alerts_popup;counter=0;u=1363
/var/www/vhosts/jamble.it/httpdocs/forum/Sources/Load.php (Linea 3904)  Informazioni di backtrace

Type of error: Critical
Error Messagge:
JSON decode error: The maximum stack depth has been exceeded


Smf version  2.1.4

Mods installed

1   Forum Width Setting   1.2   
2   TinyPortal   2.2.2   
3   Pretty URLs   2.5.1c   
4   Ultimate Menu   2.0.2   
5   Ad Management   3.5d   
6   Video Embed   1.0   
7   FancyBox 4 SMF   1.1.1
8   Google Analytics Code   1.6   
9   Optimus   2.10.5 [12.04.22]   
10   TopicRenamer   2.2   
11   SoundCloud Embed Widget   1.3   
12   Simple Audio Video Embedder   7.0   
13   SMF 2.1.4 Update   1.0   
14   Alternate User Posting   2.1.2   
15   Track IP on hxxp:ip-adress.com [nonactive]   1.2   
16   SMF 2.1.3 Update   1.0
17   Message Bookmarks   0.9.1



Php version : 8.2.10
MySQL version : 5.5.68-1.el7




Any ideas as to what's gone wrong?

Thanks a lot !!
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: live627 on September 28, 2023, 02:27:16 AM
Can you post the backtrace. This error could prove tricky to solve.
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: Slaps on September 28, 2023, 06:26:17 AM
Thank you, here's the backtrace:


Tipo di errore
Critical

Messaggio di errore
Errore di decodifica Json: La lunghezza massima dello stack รจ stata superata
File

/var/www/vhosts/jamble.it/httpdocs/forum/Sources/Load.php
Linea
3904

URL della pagina che ha causato l'errore
https://forum.jamble.it/index.php?action=profile;area=alerts_popup;counter=0;u=1363

Informazioni di backtrace
#0: smf_json_decode()
Chiamata da /var/www/vhosts/jamble.it/httpdocs/forum/Sources/Load.php nella linea 3904
#1: cache_get_data()
Chiamata da /var/www/vhosts/jamble.it/httpdocs/forum/Sources/PrettyUrls-Filters.php nella linea 225
#2: pretty_rewrite_buffer_fromcache()
Chiamata da /var/www/vhosts/jamble.it/httpdocs/forum/Sources/PrettyUrls-Filters.php nella linea 21
#3: pretty_rewrite_buffer()
Chiamata da /var/www/vhosts/jamble.it/httpdocs/forum/Sources/QueryString.php nella linea 794
#4: ob_sessrewrite()
Chiamata da sconosciuto nella linea -1
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: live627 on September 28, 2023, 04:01:08 PM
That helps with finding the problem. Looks like something to do with the Pretty URLs cache. I'll defer to @vbgamer45
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: vbgamer45 on September 28, 2023, 04:04:52 PM
I would use caching option instead of the database in the pretty url settings
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: live627 on September 28, 2023, 04:27:31 PM
Is that not what the backtrace claims? That the cache is already enabled?  https://github.com/VBGAMER45/SMFMods/blob/bcb25be9f92b69518f3f692280c051c90380931c/prettyurls/Base/SMF2-1/PrettyUrls-Filters.php#L225
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: vbgamer45 on September 28, 2023, 04:33:34 PM
Ah in that case the user should do the opposite enable using database tables instead of the caching option.
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: Slaps on September 29, 2023, 02:25:45 AM
Quote from: vbgamer45 on September 28, 2023, 04:04:52 PMI would use caching option instead of the database in the pretty url settings


Quote from: live627 on September 28, 2023, 04:27:31 PMIs that not what the backtrace claims? That the cache is already enabled?  https://github.com/VBGAMER45/SMFMods/blob/bcb25be9f92b69518f3f692280c051c90380931c/prettyurls/Base/SMF2-1/PrettyUrls-Filters.php#L225


Thank you, guys!
I'm using the cache. I'm gonna try to use the DB instead, although I would not because the database considerably increases.

Thank you.
Title: Re: JSON decode error: The maximum stack depth has been exceeded
Post by: Slaps on September 30, 2023, 11:22:19 AM
I think I got it.
It seems it was the "profile" check box (not checked) of prettyurl settings. >:(