Allegato nel primo post - pagina bianca

Aperto da Flavio93Zena, Martedì - 01 Maggio 2018 - 02:03

0 Utenti e 1 Visitatore stanno visualizzando questa discussione.

Flavio93Zena

Boh non capisco... Un forum che amministro ha un problema stranissimo, i post con allegati che sono nel messaggio di apertura del topic causano una pagina bianca - nessun errore nel log di smf, nessun errore nel log del server (anzi! code 200 OK), nessun errore nel raw access log.
Se gli allegati vengono postati in qualunque altro messaggio che non sia il primo, la pagina carica!
Esempio di un post bianco: https://www.fieldlines.com/index.php/topic,149493.0.html
Esempio di post con allegato non nel primo post: https://www.fieldlines.com/index.php/topic,149529.msg1045097.html#msg1045097

Nota: se provo ad inserire un topic con allegato, viene postato ma la pagina non carica.
Nota 2: se provo a vedere il topic dalla lista dei topic dell'utente POSSO vedere il dannato topic con allegato (ma solo il primo messaggio, essendo la lista dei topic).
Nota 3: posso cliccare su rispondi dalla lista dei topic dell'utente e vengo rimandato alla pagina di risposta che funziona, se non per il fatto che l'allegato è mostrato come attach=1 (ILA di Spuds, che anche se disinstallata/disattivata/attivata non cambia nulla).

Sono piuttosto sicuro di aver sbagliato io stesso qualcosa da qualche parte, ma siccome il 2018 finora è stato uno schifo non sono riuscito a dedicarmi a nulla :( Stesso discorso per http://www.italiansmf.net/forum/index.php?topic=2442 sul quale tornerò si spera a breve.
Grazie in anticipo :-[

Filippo

Intanto i link in alto sono inaccessibili ai visitatori......

Flavio93Zena

#2
Ok ne ho corretto uno e non riesco a riprodurre l'errore in una board pubblica. Dire che non ha un caxxo di senso è un eufemismo, riesco a riprodurre l'errore nelle sezioni visitabili da registrati... Continuo a provare.

EDIT: le condizioni per riprodurre l'errore sono che l'allegato sia nel primo post e la board non sia pubblica (no visitatori, irrilevanti gli altri gruppi).
EDIT 2: account di prova - username TestAccount pass: Testing1

emanuele

#3
Non è che è il solito problema degli allegati troppo grossi che vanno in out of memory quanto SMF tenta di ridimensionarli?
Però non spiegherebbe il discorso dei gruppi.

L'alternativa potrebbe essere un file con un errore di sintassi.

Oppure: mod installati?

Flavio93Zena

#4
Ah ho dimenticato, sì ho provato ad installare quella mod per la memoria ma non fa differenza. Ho caricato un allegato piuttosto piccolo nella sezione admin e anche quello ha dato pagina bianca.
Mod installati ho provato a disinstallare qualunque cosa relativa agli allegati senza alcun miglioramento :/

1. Attachments in Topics 1.0 N/A [ List Files ] [ Delete ]
2. Avatar for banned members 1.0 N/A [ Install Mod ] [ List Files ] [ Delete ]
3. Copyright and Footer Links 3.2 N/A [ Install Mod ] [ List Files ] [ Delete ]
4. Image Attachment Details 1.1 N/A [ Install Mod ] [ List Files ] [ Delete ]
5. Image Processing Memory Limit 0.1.2 N/A [ Install Mod ] [ List Files ] [ Delete ]
6. Prevent Adding Signature Images And Links 2.0 N/A [ Install Mod ] [ List Files ] [ Delete ]
7. Simple Audio Video Embedder 4.0.3 N/A [ Install Mod ] [ List Files ] [ Delete ]
8. ssi_multiBoardNews 1.1 N/A [ List Files ] [ Delete ]
9. Tapatalk SMF 2.0 RC4/RC5/Final Plugin 3.0.1 N/A [ Install Mod ] [ List Files ] [ Delete ]
10. Error Log Counter 1.0  February 16, 2012, 12:00:04 AM [ Uninstall ] [ List Files ] [ Delete ]
11. Ad Managment 3.0.1  February 16, 2012, 02:23:11 AM [ Uninstall ] [ List Files ] [ Delete ]
12. Country Flags 2.0.1a  February 16, 2012, 02:24:40 AM [ Uninstall ] [ List Files ] [ Delete ]
13. Google Search Your Site 2.0  March 07, 2012, 06:11:22 AM [ Uninstall ] [ List Files ] [ Delete ]
14. Stop Forum Spam 1.0  November 15, 2012, 06:21:48 PM [ Uninstall ] [ List Files ] [ Delete ]
15. KeyCAPTCHA for SMF 2.6  January 06, 2014, 09:56:04 PM [ Uninstall ] [ List Files ] [ Delete ]
16. Ohara YouTube Embed 1.0  August 29, 2015, 07:56:31 AM [ Uninstall ] [ List Files ] [ Delete ]
17. Attachment List In Recent Posts 1.3  January 05, 2018, 04:52:24 PM [ Uninstall ] [ List Files ] [ Delete ]
18. Anti-Spam Links 1.0.1  January 14, 2018, 07:03:21 AM [ Uninstall ] [ List Files ] [ Delete ]
19. Optimus 1.9.6  April 07, 2018, 12:48:35 AM [ Uninstall ] [ List Files ] [ Delete ]
20. Integration Hooks Report 1.5.3  May 01, 2018, 02:30:14 AM [ Uninstall ] [ List Files ] [ Delete ]
21. Resize Attached Images 2.4.1  May 01, 2018, 03:06:11 AM [ Uninstall ] [ List Files ] [ Delete ]
22. InLine Attachments 1.2.1  May 01, 2018, 03:08:18 AM [ Uninstall ] [ List Files ] [ Delete ]
23. Sortable Packages (and Installed Time) 1.3.5  May 01, 2018, 03:42:32 AM [ Uninstall ] [ List Files ] [ Delete ]

(Quell'Attachments in topics è disinstallata)

emanuele

L'unica è fare un po' di debug.
Il modo "facile" è bloccare l'esecuzione in punti specifici cercando di circoscrivere il problema.
Io di solito uso qualcosa tipo:

    echo "here";
    die();


inizio a posizionarlo in index.php e ricarico la pagina del forum, se vedo "here" sposto il codice più avanti, se non vedo niente sposto indietro.
Quando ho identificato la riga che fallisce, entro nella funzione in questione e ripeto l'esercizio fino a che non ho identificato l'istruzione esatta che da il problema.
A quel punto è tutto in discesa.

Flavio93Zena

#6
Quando metto il die prima di
obExit(null, null, true);
vedo here, altrimenti no. Nelle altre pagine del forum è alla fine della pagina, dopo il copyright.

Riconduce a Subs.php, in obExit
function obExit($header = null, $do_footer = null, $from_index = false, $from_fatal_error = false)
{
global $context, $settings, $modSettings, $txt, $smcFunc;
static $header_done = false, $footer_done = false, $level = 0, $has_fatal_error = false;

// Attempt to prevent a recursive loop.
++$level;
if ($level > 1 && !$from_fatal_error && !$has_fatal_error)
exit;
if ($from_fatal_error)
$has_fatal_error = true;

// Clear out the stat cache.
trackStats();

// If we have mail to send, send it.
if (!empty($context['flush_mail']))
AddMailQueue(true);

$do_header = $header === null ? !$header_done : $header;
if ($do_footer === null)
$do_footer = $do_header;

// Has the template/header been done yet?
if ($do_header)
{
// Was the page title set last minute? Also update the HTML safe one.
if (!empty($context['page_title']) && empty($context['page_title_html_safe']))
$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title']));

// Start up the session URL fixer.
ob_start('ob_sessrewrite');

if (!empty($settings['output_buffers']) && is_string($settings['output_buffers']))
$buffers = explode(',', $settings['output_buffers']);
elseif (!empty($settings['output_buffers']))
$buffers = $settings['output_buffers'];
else
$buffers = array();

if (isset($modSettings['integrate_buffer']))
$buffers = array_merge(explode(',', $modSettings['integrate_buffer']), $buffers);

if (!empty($buffers))
foreach ($buffers as $function)
{
$function = trim($function);
$call = strpos($function, '::') !== false ? explode('::', $function) : $function;

// Is it valid?
if (is_callable($call))
ob_start($call);
}
echo 'here';
die();
// Display the screen in the logical order.
template_header();
$header_done = true;
}
if ($do_footer)
{
if (WIRELESS && !isset($context['sub_template']))
fatal_lang_error('wireless_error_notyet', false);

// Just show the footer, then.
loadSubTemplate(isset($context['sub_template']) ? $context['sub_template'] : 'main');

// Anything special to put out?
if (!empty($context['insert_after_template']) && !isset($_REQUEST['xml']))
echo $context['insert_after_template'];

// Just so we don't get caught in an endless loop of errors from the footer...
if (!$footer_done)
{
$footer_done = true;
template_footer();

// (since this is just debugging... it's okay that it's after </html>.)
if (!isset($_REQUEST['xml']))
db_debug_junk();
}
}

// Remember this URL in case someone doesn't like sending HTTP_REFERER.
if (strpos($_SERVER['REQUEST_URL'], 'action=dlattach') === false && strpos($_SERVER['REQUEST_URL'], 'action=viewsmfile') === false)
$_SESSION['old_url'] = $_SERVER['REQUEST_URL'];

// For session check verfication.... don't switch browsers...
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

if (!empty($settings['strict_doctype']))
{
// The theme author wants to use the STRICT doctype (only God knows why).
$temp = ob_get_contents();
if (function_exists('ob_clean'))
ob_clean();
else
{
ob_end_clean();
ob_start('ob_sessrewrite');
}

echo strtr($temp, array(
'var smf_iso_case_folding' => 'var target_blank = \'_blank\'; var smf_iso_case_folding',
'target="_blank"' => 'onclick="this.target=target_blank"'));
}

// Hand off the output to the portal, etc. we're integrated with.
call_integration_hook('integrate_exit', array($do_footer && !WIRELESS));

// Don't exit if we're coming from index.php; that will pass through normally.
if (!$from_index || WIRELESS)
exit;
}

Prima di // Display the screen in the logical order.
template_header();
si vede, dopo no.
Il che conduce a template_header, immediatamente a
setupThemeContext();, se lascio eseguire quello non si vede nulla.
Per cui si prosegue a // Setup the main menu items.
setupMenuContext();

E poi a // Allow editing menu buttons easily.
call_integration_hook('integrate_menu_buttons', array(&$buttons));

E ora, cosa caxxo c'entra il menu con gli allegati? Perchè dovrebbe dare errore ad un hook del menu solo in un post con le condizioni sopra descritte?!

.....OOOOOOK. Ho disinstallato Optimus e la pagina carica ??? No io boh... *headdesk* hai qualche idea del motivo?

EDIT 277: La mod era la 1.9.6. La 1.9.7.3 non crasha più. Sto bestemmiando in cinese ma ok, grazie -_-

emanuele


Flavio93Zena

Vabbè io marco come risolto, chiunque abbia questo stupido problema controlli la lista delle mod installate, se c'è Optimus, si preoccupi di aggiornarla.
E ora si tornerà sull'anteprima allegati.

Discussioni simili (3)