Error invalid ajax data

Moderator: General Support Moderators

Moderator: General Support Moderators

archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

joomla update error invalid ajax data

Getting the error of error invalid ajax data on multiple sites now try to upgrade to 3.8.0 from 3.7.x
PHP 7.1.7 Mysql 10.1.18-MariaDB
How does one fix this I see no errors in the error logs

Help Please


User avatar

leolam

Joomla! Master
Joomla! Master
Posts: 20521
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S’pore/Bogor/ North America
Contact:

Re: joomla update error invalid ajax data

Post

by leolam » Tue Sep 19, 2017 5:13 pm

Please post the precise message

Leo 8)


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Tue Sep 19, 2017 5:15 pm

ERROR:
Invalid AJAX data:

Last edited by archieb on Tue Sep 19, 2017 5:19 pm, edited 2 times in total.


User avatar

leolam

Joomla! Master
Joomla! Master
Posts: 20521
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S’pore/Bogor/ North America
Contact:

Re: joomla update error invalid ajax data

Post

by leolam » Tue Sep 19, 2017 5:17 pm

I did not ask for code. I asked for the error message. Please remove the code or I will have it removed?

Leo 8)


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Tue Sep 19, 2017 5:22 pm

more info from httpd error logs
PHP Warning: get_headers(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/.sites/64/site14/web/administrator/components/com_joomlaupdate/models/default.php on line 254, referer: https://www.debrahengst.com/administrat … omlaupdate

PHP Warning: get_headers(): This function may only be used against URLs in /home/.sites/64/site14/web/administrator/components/com_joomlaupdate/models/default.php on line 254, referer: https://www.debrahengst.com/administrat … omlaupdate


User avatar

leolam

Joomla! Master
Joomla! Master
Posts: 20521
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S’pore/Bogor/ North America
Contact:

Re: joomla update error invalid ajax data

Post

by leolam » Tue Sep 19, 2017 5:52 pm

I am not asking for that. What is the Ajax error you get? Something with Ajax Loading error etc?

Leo 8)



archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Tue Sep 19, 2017 6:06 pm

No Ajax error just get this:
ERROR:
Invalid AJAX data:


User avatar

leolam

Joomla! Master
Joomla! Master
Posts: 20521
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S’pore/Bogor/ North America
Contact:

Re: joomla update error invalid ajax data

Post

by leolam » Tue Sep 19, 2017 6:09 pm


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Tue Sep 19, 2017 6:15 pm

I really don’t think that is the issue as some site update no issue other don’t on the same server. I have check the other foru servers same thing some do and some don’t update
RC


User avatar

leolam

Joomla! Master
Joomla! Master
Posts: 20521
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S’pore/Bogor/ North America
Contact:

Re: joomla update error invalid ajax data

Post

by leolam » Tue Sep 19, 2017 6:17 pm

Well fine if you think you should not check my advise I wish you all the best. (Doing this only for 12 years……)

Leo 8)


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Tue Sep 19, 2017 6:20 pm

I thought I did how would I check that? I am the host


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Tue Sep 19, 2017 6:27 pm

the php.ini
; http://php.net/disable-functions
disable_functions = exec,system,passthru,shell_exec,popen,escapeshellcmd,proc_open,proc_nice,ini_restore,eval


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Tue Sep 19, 2017 6:44 pm

if you want I can give you access joomla admin


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Tue Sep 19, 2017 10:00 pm

still does not work


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Wed Sep 20, 2017 2:46 pm

Hey Leolam anything esle i can try?
RC


User avatar

leolam

Joomla! Master
Joomla! Master
Posts: 20521
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S’pore/Bogor/ North America
Contact:

Re: joomla update error invalid ajax data

Post

by leolam » Thu Sep 21, 2017 3:51 pm

First of all refrain from sending me on my email the output of the FPA when I have not asked for that? Thanks!

Next you have a bad setup of your server and that needs to be addressed. I will reply to your other email shortly. You need a proper server setup and your issues will be resolved

Leo 8)


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Thu Sep 21, 2017 3:56 pm

OK are you going to explain bad setup on my servers?

ok no problem you did post this:

Postby leolam » Tue Sep 19, 2017 12:54 pm
But I think to see where this is coming from. Please post output of http://forum.joomla.org/viewtopic.php?f=621&t=582860 to confirm my thinking so I can help

Leo 8)

Archieb


User avatar

leolam

Joomla! Master
Joomla! Master
Posts: 20521
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S’pore/Bogor/ North America
Contact:

Re: joomla update error invalid ajax data

Post

by leolam » Thu Sep 21, 2017 4:10 pm

You have disabled functions which should not be disable causing these errors and some others such as cUrl and fopen etc etc

Did I ask you to post that to my email? NO the FPA is posted on the forums so all people who assist can reply. Please note the first .dot of the forum rules and I did not ask you to post this (especially not in that format!) in my email

Leo 8)


archieb

Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Sep 26, 2008 7:12 pm

Re: joomla update error invalid ajax data

Post

by archieb » Thu Sep 21, 2017 4:23 pm

OK thanks :-[



Return to “General Questions/New to Joomla! 3.x”


Jump to

  • Joomla! Announcements
  • ↳   Announcements
  • ↳   Announcements Discussions
  • Joomla! 4.x — Ask Support Questions Here
  • ↳   General Questions/New to Joomla! 4.x
  • ↳   Installation Joomla! 4.x
  • ↳   Administration Joomla! 4.x
  • ↳   Migrating and Upgrading to Joomla! 4.x
  • ↳   Extensions for Joomla! 4.x
  • ↳   Security in Joomla! 4.x
  • ↳   Templates for Joomla! 4.x
  • ↳   Search Engine Optimization (Joomla! SEO) in Joomla! 4.x
  • ↳   Language — Joomla! 4.x
  • ↳   Performance — Joomla! 4.x
  • ↳   Joomla! 4.x Coding
  • Joomla! 3.x — Ask Support Questions Here
  • ↳   General Questions/New to Joomla! 3.x
  • ↳   Installation Joomla! 3.x
  • ↳   Joomla! 3.x on IIS webserver
  • ↳   Administration Joomla! 3.x
  • ↳   Access Control List (ACL) in Joomla! 3.x
  • ↳   Migrating and Upgrading to Joomla! 3.x
  • ↳   Security in Joomla! 3.x
  • ↳   Extensions for Joomla! 3.x
  • ↳   Templates for Joomla! 3.x
  • ↳   Search Engine Optimization (Joomla! SEO) in Joomla! 3.x
  • ↳   Language — Joomla! 3.x
  • ↳   Performance — Joomla! 3.x
  • ↳   Joomla! 3.x Coding
  • Joomla! Versions which are End of Life
  • ↳   Joomla! 2.5 — End of Life 31 Dec 2014
  • ↳   General Questions/New to Joomla! 2.5
  • ↳   Installation Joomla! 2.5
  • ↳   Joomla! 2.5 on IIS webserver
  • ↳   Administration Joomla! 2.5
  • ↳   Access Control List (ACL) in Joomla! 2.5
  • ↳   Migrating and Upgrading to Joomla! 2.5
  • ↳   Security in Joomla! 2.5
  • ↳   Extensions for Joomla! 2.5
  • ↳   Templates for Joomla! 2.5
  • ↳   Search Engine Optimization (Joomla! SEO) in Joomla! 2.5
  • ↳   Language — Joomla! 2.5
  • ↳   Performance — Joomla! 2.5
  • ↳   Joomla! 1.5 — End of Life Sep 2012
  • ↳   General Questions/New to Joomla! 1.5
  • ↳   Installation 1.5
  • ↳   Joomla! 1.5 on IIS webserver
  • ↳   Administration 1.5
  • ↳   Migrating and Upgrading to Joomla! 1.5
  • ↳   Security in Joomla! 1.5
  • ↳   Extensions for Joomla! 1.5
  • ↳   Templates for Joomla! 1.5
  • ↳   Search Engine Optimization (Joomla! SEO) in Joomla! 1.5
  • ↳   Language — Joomla! 1.5
  • ↳   Performance — Joomla! 1.5
  • ↳   Joomla! 1.0 — End of Life 22 July 2009
  • ↳   Installation — 1.0.x
  • ↳   Upgrading — 1.0.x
  • ↳   Security — 1.0.x
  • ↳   3rd Party/Non Joomla! Security Issues
  • ↳   Administration — 1.0.x
  • ↳   Extensions — 1.0.x
  • ↳   Components
  • ↳   Modules
  • ↳   Plugins/Mambots
  • ↳   WYSIWYG Editors — 1.0.x
  • ↳   Integration & Bridges — 1.0.x
  • ↳   phpbb — Joomla! Integration
  • ↳   Templates & CSS — 1.0.x
  • ↳   Language — 1.0.x
  • ↳   Joom!Fish and Multilingual Sites
  • ↳   Performance — 1.0.x
  • ↳   General Questions — 1.0.x
  • Joomla! International Language Support
  • ↳   International Zone
  • ↳   Arabic Forum
  • ↳   تنبيهات هامة
  • ↳   الدروس
  • ↳   4.x جوملا!
  • ↳   جوملا! 1.6/1.7
  • ↳   الأسئلة الشائعة
  • ↳   التثبيت و الترقية
  • ↳   الحماية — و تحسين السرعة والأداء
  • ↳   لوحة التحكم
  • ↳   الإضافات البرمجية
  • ↳   تعريب جوملا! و الإضافات البرمجية
  • ↳   القوالب و التصميم
  • ↳   صداقة محركات البحث
  • ↳   القسم العام
  • ↳   1.5 !جوملا
  • ↳   الأسئلة الشائعة
  • ↳   التثبيت و الترقية
  • ↳   الحماية — و تحسين السرعة والأداء
  • ↳   لوحة التحكم
  • ↳   الإضافات البرمجية
  • ↳   تعريب جوملا! و الإضافات البرمجية
  • ↳   القوالب و التصميم
  • ↳   صداقة محركات البحث
  • ↳   القسم العام
  • ↳   جوملا! 1.0
  • ↳   الأسئلة الشائـعة
  • ↳   التثبيت
  • ↳   لوحة التحكم
  • ↳   الإضافات البرمجية
  • ↳   الإضافات المعرّبة
  • ↳   القوالب و التصميم
  • ↳   الحماية — تحسين السرعة والأداء — صداقة محركات البحث
  • ↳   القسم العام
  • ↳   القسم العام
  • ↳   !عرض موقعك بجوملا
  • ↳   الأرشيف
  • ↳   Bengali Forum
  • ↳   Bosnian Forum
  • ↳   Joomla! 1.5
  • ↳   Instalacija i prvi koraci
  • ↳   Ekstenzije
  • ↳   Templejti
  • ↳   Moduli
  • ↳   Prevodi i dokumentacija
  • ↳   Joomla! 1.7 / Joomla! 1.6
  • ↳   Catalan Forum
  • ↳   Notícies
  • ↳   Temes sobre l’administració
  • ↳   Temes sobre la traducció
  • ↳   Components, mòduls i joombots
  • ↳   Temes de disseny
  • ↳   Webs realitzades amb Joomla!
  • ↳   Offtopics
  • ↳   Chinese Forum
  • ↳   Croatian Forum
  • ↳   Danish Forum
  • ↳   Meddelelser
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x (Anbefalet til nye installationer. Nyeste funktionalitet)
  • ↳   Installation, backup, opdatering og flytning — Godt igang
  • ↳   Administration — Generel brug
  • ↳   Komponenter, Moduler og Plugins
  • ↳   Template, CSS og Design
  • ↳   Nethandel, betaling m.m.
  • ↳   Ældre versioner (disse vedligeholdes ikke længere fra officiel side)
  • ↳   Joomla! 2.5 (Supporteres indtil 31. dec. 2014)
  • ↳   Installation, backup, opdatering og flytning — Godt igang
  • ↳   Administration — Generel brug
  • ↳   Komponenter, Moduler og Plugins
  • ↳   Template, CSS og Design
  • ↳   Nethandel, betaling m.m.
  • ↳   Joomla 1.5 (Tidligere langtidssupporteret version indtil sep. 2012)
  • ↳   Installation, backup, opdatering og flytning — Godt igang
  • ↳   Administration — Generel brug
  • ↳   Komponenter, Moduler og Plugins
  • ↳   Template, CSS og Design
  • ↳   Nethandel, betaling m.m.
  • ↳   Joomla 1.0 (Udgået version, der blev afløst af 1.5 i 2008)
  • ↳   Installation, backup, opdatering og flytning — Godt igang
  • ↳   Administration — Generel brug
  • ↳   Komponenter, Moduler og Mambots
  • ↳   Template, CSS og Design
  • ↳   Nethandel, betaling m.m.
  • ↳   Oversættelser (lokalisering)
  • ↳   Joomla brugergrupper i Danmark
  • ↳   JUG Kolding
  • ↳   JUG København
  • ↳   JUG Odense
  • ↳   JUG Århus
  • ↳   JUG Sorø
  • ↳   Kommerciel (betalt) hjælp ønskes
  • ↳   SEO
  • ↳   FAQ — Dokumentation og vejledninger
  • ↳   Vis dit websted
  • ↳   Afviste ‘Vis dit websted’ indlæg
  • ↳   Diverse (Off topic)
  • ↳   Dutch Forum
  • ↳   Aankondigingen
  • ↳   Algemene vragen
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Installatie 3.x
  • ↳   Extensies 3.x
  • ↳   Templates 3.x
  • ↳   Joomla! 2.5
  • ↳   Installatie 2.5
  • ↳   Componenten 2.5
  • ↳   Modules 2.5
  • ↳   Plugins 2.5
  • ↳   Templates 2.5
  • ↳   Joomla! 1.5
  • ↳   Installatie
  • ↳   Componenten
  • ↳   Modules
  • ↳   Plugins
  • ↳   Templates
  • ↳   Joomla! 1.0
  • ↳   Installatie 1.0.x
  • ↳   Componenten 1.0.x
  • ↳   Modules 1.0.x
  • ↳   Mambots 1.0.x
  • ↳   Templates 1.0.x
  • ↳   Vertalingen
  • ↳   Offtopic
  • ↳   Show jouw website
  • ↳   Filipino Forum
  • ↳   International Support Center
  • ↳   Pinoy General Discussion & Archives
  • ↳   Site Showcase
  • ↳   Events
  • ↳   Design Tips and Tricks
  • ↳   Tsismis Zone
  • ↳   Pinoy Translation Zone
  • ↳   Pinoy Forum Archives
  • ↳   Joomla! Philippines Local Forum www.joomla.org.ph
  • ↳   Finnish Forum
  • ↳   French Forum
  • ↳   Les annonces!
  • ↳   Le bistrot!
  • ↳   L’expo!
  • ↳   J! 4.x — L’atelier!
  • ↳   J! 3.x — L’atelier!
  • ↳   3.x — Questions générales, nouvel utilisateur
  • ↳   3.x — Installation, migration et mise à jour
  • ↳   3.x — Sécurité et performances
  • ↳   3.x — Extensions tierce partie
  • ↳   3.x — Templates et design
  • ↳   3.x — Développement
  • ↳   3.x — Ressources
  • ↳   J! 2.5.x — L’atelier!
  • ↳   2.5 — Questions générales
  • ↳   2.5 — Installation, migration et mise à jour
  • ↳   2.5 — Sécurité et performances
  • ↳   2.5 — Extensions tierce partie
  • ↳   2.5 — Templates et design
  • ↳   2.5 — Développement
  • ↳   2.5 — Ressources
  • ↳   J! 1.5.x — L’atelier!
  • ↳   1.5 — Questions générales
  • ↳   1.5 — Installation, migration et mise à jour
  • ↳   1.5 — Sécurité et performances
  • ↳   1.5 — Extensions tierce partie
  • ↳   1.5 — Templates et design
  • ↳   1.5 — Développement
  • ↳   1.5 — Ressources
  • ↳   J! 1.0.x — L’atelier!
  • ↳   1.0 — Questions générales
  • ↳   1.0 — Installation et mise à jour
  • ↳   1.0 — Sécurité
  • ↳   1.0 — Extensions tierce partie
  • ↳   1.0 — Templates et design
  • ↳   1.0 — Développement
  • ↳   1.0 — Ressources
  • ↳   Besoin d’un professionel ?
  • ↳   Extensions Open Source pour Joomla!
  • ↳   German Forum
  • ↳   Ankündigungen
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Allgemeine Fragen
  • ↳   Installation und erste Schritte
  • ↳   Komponenten, Module, Plugins
  • ↳   Template, CSS und Designfragen
  • ↳   Entwicklerforum
  • ↳   Zeige Deine Webseite
  • ↳   Joomla! 2.5
  • ↳   Allgemeine Fragen
  • ↳   Installation und erste Schritte
  • ↳   Komponenten, Module, Plugins
  • ↳   Template, CSS und Designfragen
  • ↳   Entwicklerforum
  • ↳   Zeige Deine Webseite
  • ↳   Joomla! 1.5
  • ↳   Allgemeine Fragen
  • ↳   Installation und erste Schritte
  • ↳   Komponenten, Module, Plugins
  • ↳   Template, CSS und Designfragen
  • ↳   Entwicklerforum
  • ↳   Zeige Deine Webseite
  • ↳   Professioneller Service
  • ↳   Sonstiges (Offtopic)
  • ↳   Archiv
  • ↳   Joomla! 1.0
  • ↳   Allgemeine Fragen 1.0.x
  • ↳   Installation und erste Schritte 1.0.x
  • ↳   Komponenten, Module, Mambots 1.0.x
  • ↳   Template, CSS und Designfragen 1.0.x
  • ↳   Entwicklerforum 1.0.x
  • ↳   Zeige Deine Webseite 1.0.x
  • ↳   Greek Forum
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Joomla! 2.5.x
  • ↳   Joomla! 1.5.x
  • ↳   Joomla! 1.0.x
  • ↳   Hebrew Forum
  • ↳   Indic Languages Forum
  • ↳   Indonesian Forum
  • ↳   FAQ
  • ↳   Bantuan
  • ↳   Komponen
  • ↳   Modul
  • ↳   Template
  • ↳   Diskusi
  • ↳   Italian Forum
  • ↳   Guide
  • ↳   Traduzioni
  • ↳   Componenti — Moduli — Plugins
  • ↳   Template — Grafica
  • ↳   Notizie
  • ↳   Prodotti Open Source per Joomla!
  • ↳   Richieste professionali
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Joomla! 2.5.x
  • ↳   Joomla! 1.x
  • ↳   Latvian Forum
  • ↳   Lithuanian Forum
  • ↳   Joomla! 4.x
  • ↳   Joomla! 1.5
  • ↳   Joomla! 1.7 / Joomla! 1.6
  • ↳   Joomla! 1.0
  • ↳   Vertimai ir Kalba
  • ↳   Malaysian Forum
  • ↳   Solved
  • ↳   Norwegian Forum
  • ↳   Informasjon
  • ↳   Arkiverte annonseringer
  • ↳   FAQ — Ofte spurte spørsmål
  • ↳   Arkiv
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Administrasjon/installasjon
  • ↳   Migrering/Oppdatering
  • ↳   Template, CSS og design
  • ↳   Komponenter/moduler/programutvidelser
  • ↳   Sikkerhet
  • ↳   Generelt
  • ↳   Netthandel, betaling m.m.
  • ↳   VirtueMart
  • ↳   Andre nettbutikkløsninger
  • ↳   Generelt
  • ↳   Oversettelser
  • ↳   Fremvisning av sider (Show off)
  • ↳   Avviste fremvisninger
  • ↳   Diverse (off topic)
  • ↳   Kommersiell hjelp ønskes
  • ↳   Eldre versjoner av Joomla!
  • ↳   Joomla! 1.0
  • ↳   Administrasjon/installasjon
  • ↳   Template, CSS og design
  • ↳   Komponenter/moduler/mambots
  • ↳   Sikkerhet
  • ↳   Generelt
  • ↳   Joomla! 1.5
  • ↳   Administrasjon/installasjon
  • ↳   Migrering/Oppdatering
  • ↳   Template, CSS og design
  • ↳   Komponenter/moduler/programutvidelser
  • ↳   Sikkerhet
  • ↳   Generelt
  • ↳   Joomla! 2.5
  • ↳   Administrasjon/installasjon
  • ↳   Migrering/Oppdatering
  • ↳   Template, CSS og design
  • ↳   Komponenter/moduler/programutvidelser
  • ↳   Sikkerhet
  • ↳   Generelt
  • ↳   Persian Forum
  • ↳   قالب ها
  • ↳   مدیریت
  • ↳   سوالهای عمومی
  • ↳   نصب
  • ↳   مامبوت ها
  • ↳   ماژولها
  • ↳   کامپوننت ها
  • ↳   Polish Forum
  • ↳   Instalacja i aktualizacja
  • ↳   Administracja
  • ↳   Komponenty, moduły, wtyczki
  • ↳   Szablony
  • ↳   Paczta i Podziwiajta
  • ↳   Modyfikacje i własne rozwiązania
  • ↳   Tłumaczenia
  • ↳   FAQ
  • ↳   Tips&Tricks
  • ↳   Dokumentacja
  • ↳   Profesjonalne usługi
  • ↳   Portuguese Forum
  • ↳   Componentes, módulos e mambots
  • ↳   Programação e desenvolvimento
  • ↳   Segurança
  • ↳   Sites dos usuários
  • ↳   Off-topic
  • ↳   Tradução
  • ↳   Templates
  • ↳   Romanian Forum
  • ↳   Traduceri
  • ↳   Russian Forum
  • ↳   Объявления по Joomla!
  • ↳   Безопасность Joomla!
  • ↳   Joomla 4.x — Задайте здесь свой вопрос по поддержке
  • ↳   Joomla 3.x — Задайте здесь свой вопрос по поддержке
  • ↳   Общие вопросы/Новичок в Joomla! 3.x
  • ↳   Установка Joomla! 3.x
  • ↳   Миграция и переход на Joomla! 3.x
  • ↳   Расширения для Joomla! 3.x
  • ↳   Многоязычные веб-сайты на Joomla 3.x
  • ↳   Joomla 2.5 — Задайте здесь свой вопрос по поддержке
  • ↳   Общие вопросы/Новичок в Joomla! 2.5
  • ↳   Установка Joomla! 2.5
  • ↳   Расширения для Joomla! 2.5
  • ↳   Русский язык Joomla! 2.5
  • ↳   Serbian/Montenegrin Forum
  • ↳   Tehnička pitanja
  • ↳   Instalacija i početnička pitanja
  • ↳   Šabloni
  • ↳   Prevod i dokumentacija
  • ↳   Ćaskanje
  • ↳   Bezbednost
  • ↳   Joomla! dodaci
  • ↳   Pravna pitanja
  • ↳   Arhiva
  • ↳   Joomla! Događaji i Zajednica
  • ↳   Izlog (spisak) sajtova radjenih u Joomla! CMS-u
  • ↳   Profesionalne usluge
  • ↳   Slovak Forum
  • ↳   Spanish Forum
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Migración y actualización a Joomla 3.x
  • ↳   Versiones de Joomla! obsoletas
  • ↳   Joomla! 2.5
  • ↳   Joomla! 1.5
  • ↳   Extensiones
  • ↳   Plantillas (templates) y diseño
  • ↳   Idioma y traducciones
  • ↳   SEO para Joomla!
  • ↳   Seguridad y rendimiento
  • ↳   Productos de Código Abierto para Joomla!
  • ↳   Servicios profesionales
  • ↳   Salón de la comunidad Ñ
  • ↳   Swedish Forum
  • ↳   Meddelanden
  • ↳   Forum Joomla! 4.x
  • ↳   Forum Joomla! 3.x
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och plugin
  • ↳   Mallar (templates) och design
  • ↳   Äldre versioner
  • ↳   Forum Joomla! 1.0
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och Mambots
  • ↳   Mallar (templates) och design
  • ↳   Forum Joomla! 1.7 / Joomla! 1.6
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och plugin
  • ↳   Mallar (templates) och design
  • ↳   Forum Joomla! 1.5
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och plugin
  • ↳   Mallar (templates) och design
  • ↳   Forum Joomla! 2.5
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och plugin
  • ↳   Mallar (templates) och design
  • ↳   Översättning
  • ↳   Webbplatser gjorda i Joomla
  • ↳   Webbplatser J! 3.x
  • ↳   Webbplatser J! 2.5
  • ↳   Webbplatser Joomla! 1.7 / Joomla! 1.6
  • ↳   Webbplatser J! 1.5
  • ↳   Webbplatser J! 1.0
  • ↳   Kommersiell hjälp önskas
  • ↳   Diverse (off topic)
  • ↳   Tamil Forum
  • ↳   Thai Forum
  • ↳   โชว์เว็บไซต์ของคุณที่สร้างด้วยจูมล่า
  • ↳   เคล็ดลับการใช้งานส่วนต่างๆ เกี่ยวกับจ&#
  • ↳   คอมโพเน้นท์ โมดูล ปลักอิน ต่างๆ ที่ติดตั
  • ↳   อับเดดข่าวสารเกี่ยวกับจูมล่าลายไทย
  • ↳   Turkish Forum
  • ↳   Duyurular
  • ↳   Dersler
  • ↳   Genel Sorular
  • ↳   Bileşen, Modül, Bot
  • ↳   Eklenti Haberleri
  • ↳   Temalar
  • ↳   Vietnamese Forum
  • ↳   Gặp gỡ và giao lưu
  • ↳   Joomla Tiếng Việt
  • ↳   Cài đặt — Cấu hình
  • ↳   Thành phần mở rộng cho Joomla!
  • ↳   Hỏi đáp Joomla! 3.x
  • ↳   Hỏi đáp Joomla! 2.5
  • ↳   Hỗ trợ kỹ thuật
  • ↳   Bài viết cũ
  • ↳   Thiết kế Template
  • ↳   Joomla! 1.5
  • ↳   Hỏi đáp Joomla! 4.x
  • ↳   Welsh Forum
  • Other Forums
  • ↳   Open Source Products for Joomla!
  • ↳   The Lounge
  • ↳   Forum Post Assistant (FPA)
  • Joomla! Development Forums
  • Joomla! Official Sites & Infrastructure
  • ↳   docs.joomla.org — Feedback/Information
  • ↳   extensions.joomla.org — Feedback/Information
  • ↳   joomla.com — Feedback/Information
  • ↳   Sites & Infrastructure — Feedback/Information
  • ↳   Archived Boards — All boards closed
  • ↳   Design and Accessibility — Archived
  • ↳   Quality and Testing — Locked and Archived
  • ↳   Joomla! 1.0.x_Q&T
  • ↳   Q&T 1.0.x Resolved
  • ↳   Known Issues
  • ↳   Superseded Issues
  • ↳   Archive
  • ↳   Q&T 1.0.x Resolved — Archived
  • ↳   Known Issues — Archive
  • ↳   Superseded Issues — Archive
  • ↳   Joomla! 3.x Bug Reporting
  • ↳   Third Party Testing for Joomla! 1.5
  • ↳   Q&T 1.5.x Resolved
  • ↳   Joomla! 1.5 BETA
  • ↳   Joomla! 1.5 BETA 2
  • ↳   Reaction to the ‘Letter to the community’
  • ↳   Reaction to New Project Name
  • ↳   Logo Competition
  • ↳   Humor, Fun and Games
  • ↳   Libraries
  • ↳   patTemplate
  • ↳   com_connector — Multi Joomla Bridge
  • ↳   CiviCRM Support
  • ↳   CiviCRM Installation Issues
  • ↳   FAQ Archive
  • ↳   FAQ Discussion Board
  • ↳   3rd Party Extensions FAQ
  • ↳   FAQs not moved
  • ↳   3rd Party/Non Joomla! Security FAQ
  • ↳   Joomla! Coding 101
  • ↳   Joombie Tools of the Trade
  • ↳   Joombie Coding Q/A
  • ↳   Joombie Think Tank
  • ↳   Joombie Developer Lab
  • ↳   Joomla Forge — Archived
  • ↳   Non-Profit Organizations and Joomla!
  • ↳   Schools and Universities
  • ↳   Bangsamoro Forum
  • ↳   Joomla! 1.5 Template Contest
  • ↳   SMF — Simplemachines.org Forum
  • ↳   GPL Discussion
  • ↳   Security Announcements — Old
  • ↳   Tips & Tricks — Moving
  • ↳   Submit Your Suggested Tips & Tricks to Docs.joomla.org now please.
  • ↳   Google Summer of Code and GHOP
  • ↳   Google Summer of Code 2008
  • ↳   Proposed projects
  • ↳   Student area
  • ↳   Past Google Summer of Code Editions
  • ↳   Google’s Highly Open Participation Contest
  • ↳   Documentation
  • ↳   Suggestions, Modifications, and Corrections
  • ↳   Archive
  • ↳   1.5 Archive
  • ↳   Suggestions, Modifications & Corrections
  • ↳   Submit
  • ↳   Feedback and Suggestions
  • ↳   Applications for participation in the Development Workgroup
  • ↳   Development
  • ↳   1.5 Site Showcase — Archived
  • ↳   1.0 x Site Showcase — Archived.
  • ↳   Feature Requests — White Papers — Archived
  • ↳   Under Review — Archived
  • ↳   Accepted — Archived
  • ↳   Not Accepted — Archived
  • ↳   Wishlists and Feature Requests — Archive
  • ↳   Wishlist Archives — Archived
  • ↳   Spanish Forum — Archive
  • ↳   Papelera
  • ↳   Tutoriales
  • ↳   General
  • ↳   Salón de la Joomlaesfera hispanohablante
  • ↳   Danish Forum — Archive
  • ↳   Diskussion af Meddelelser + Sikkerhedsmeddelelser + FAQ
  • ↳   Shop.Joomla.org
  • ↳   Joomla! 1.6 RC Support [closed]
  • ↳   Joomla! 1.0 Coding
  • ↳   Core Hacks and Patches
  • ↳   Joomla! 2.5 Beta Support
  • ↳   People.joomla.org — Feedback/Information
  • ↳   Joomla! 1.5 Bug Reporting
  • ↳   Joomla! 1.5 Coding
  • ↳   Joomla! 3 Beta Support
  • ↳   Trending Topics
  • ↳   Help wanted in the community
  • ↳   templates.joomla.org — Feedback/Information
  • ↳   Certification
  • ↳   Albanian Forum
  • ↳   Azeri Forum
  • ↳   Urdu Forum
  • ↳   Basque Forum
  • ↳   Itzulpenaren inguruan
  • ↳   Laguntza teknikoa
  • ↳   Belarusian Forum
  • ↳   Maltese Forum
  • ↳   Hungarian Forum
  • ↳   Slovenian Forum
  • ↳   Japanese Forum
  • ↳   Khmer Forum
  • ↳   ពិពណ៌​ស្ថាន​បណ្ដាញ​ជុំឡា
  • ↳   ជុំឡា​ខ្មែរ​មូលដ្ឋានីយកម្ម
  • ↳   Community Blog Discussions
  • ↳   JoomlaCode.org
  • ↳   Joomla! Marketing and PR Team
  • ↳   resources.joomla.org — Feedback/Information
  • ↳   Training.Joomla.org
  • ↳   OpenSourceMatters.org
  • ↳   magazine.joomla.org — Feedback/Information
  • ↳   Site Showcase
  • ↳   Joomla! 4 Related
  • ↳   Joomla! Events
  • ↳   Joomla! Ideas Forum
  • ↳   Registered Joomla! User Groups
  • ↳   Joomla! 2.5 Coding
  • ↳   Joomla! 2.5 Bug Reporting
  • ↳   User eXperience (UX)
  • ↳   Joomla! Working Groups
  • ↳   Translations

0 Пользователей и 1 Гость просматривают эту тему.

  • 15 Ответов
  • 15565 Просмотров

Товарищи, приветствую !
использую версию Joomla 1.5.22
вот такая у меня ошибка случилась —
установил Akeeba Backup, пробовал и версию 3.0 и 3.2.7(Stable), но при создании резервной копии выдает ошибку
====
AJAX Loading Error
HTTP Status: 503 (Service Temporarily Unavailable)
Internal status: error
XHR ReadyState: 4
Raw server response:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
=====
эксперементировал с параметрами, толку ноль , правда если бекапить базу sql, но не файлы сайта и сайт целиком, то процесс заканчивает положительно.
На форуме не нашел ничего толкового, подскажите, если кто знает.

Спасибо

почему то мало эту тему обсуждают, видимо зависит от хостера, защита против ддос атак. у меня на мастерхост такая же проблема

У меня тоже мастерхост и такая же проблема. Как её решить?

C

посмотрите здесь

проблема та же решение ненайдено

Invalid AJAX data:

 >:(

« Последнее редактирование: 29.02.2012, 14:09:33 от Ambeg »

Записан

У меня вот та-же проблема
Операция резервного копирования была приостановлена, поскольку была обнаружена ошибка.
Последним сообщением об ошибке было:

AJAX Loading Error
HTTP Status: 0 (error)
Internal status: error
XHR ReadyState: 0
Raw server response:

Что может быть? как теперь бэкап сделать?   ! :D

посмотрите здесь

спасибо! помогло))

спасибо! помогло))

а мне нет=( хотя раньше проблем с бэкапом не наблюдал…буду пробовать в другое время

Тоже началась такая штука, причём на локалхосте.

An error occured
Invalid AJAX data received:

Коррекция тайм-лимитов не помогла.

Решение: распаковать архив в директорию сайта (если jpa — придётся утилиткой akeeba extract восспользоваться) и запустить через адресную строку /installation

« Последнее редактирование: 15.05.2012, 12:29:24 от duke_83 »

Записан

У меня бывает такое периодически. Перезапускаю по нескольку раз и всё нормально проходит. Тут другое кое-что есть… Установил значит компонент SEBLOD на локалку. Тонко настроил, идеально, пару дней возился. Всё отлично работает. Переношу на домен обычным способом через Akeebу, и… пипец… Белый лист. Пробовал переустановки раз 500, потратил ещё пару дней но успехом это так и не закончилось. Так что, имейте в виду, Akeeba ещё не гарант того, что ваш сайт в безопасности, и нет никаких гарантий, что после тонких настроек и многих дней работы на локалке, вы сможете установить сайт на домене.

Каждый раз выгружаю сайт, а это минимум два раза в месяц и сталкиваюсь с проблемой именно на мастерхосте! После долгой переписки и выноса им мозга, все начинает как то работать и само по себе, я так понимаю там стоит защита от доса и файл kickstart.php как будто в черном списке, то ошибку выдает, то бутсой лист. Предлагаю задолбить эту долбанную поддержку, чтобы они сделали работу с joomlой нормально. А то зачем тогда писать, что они работают с Joomla и тд… Че это за мучения!

спасибо! помогло))

тоже помогло, только там инфа немножко перепутана
максимальное время исполнения 2с
мин время 20с
не логично

не логично

согласен…
Помогает включение расширения hash в настройках модуля PHP v5.3 (мой хост на nic.ru).

Не логично, но работает для Joomla 2.5x.(хост — Hoster.by)

посмотрите здесь

не помогло :( тоже мастерхост.

После нескольких попыток удалось. Но очень долго сохранял.

« Последнее редактирование: 17.02.2014, 15:54:27 от Sfera72 »

Записан

посмотрите здесь

Спасибо вам огромное! Уже вышло несколько обновлений, а проблема по-прежнему актуальна. Способ по вашей ссылке помог. Все тот же Мастерхост, да.

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Comments

@anuragteapot

@brianteeman

possibly due to line 128 restore_finalisation.php

@mbabker

We’re going to have to get tricky with this file. The intent is to overload the core classes, so as they’re now namespaced, the overloading has to use the correct namespacing as well.

I think this is right (there are no IDE reported errors and no reported syntax errors linting the file), but I never write files using multiple namespaces, so I have no idea if this is going to do what we want it to.

https://gist.github.com/mbabker/5e171b1df99f71a30290125e0292b1d9

@astridx

I can confirm this issue.

@ReLater

@anuragteapot



Copy link


Contributor

Author

@mbabker

If the comment from @ReLater is any indication of success, just need a pull request updating administrator/components/com_joomlaupdate/restore_finalisation.php with the contents of the gist.

@ReLater

@joomla-cms-bot

@ghost

closed as having Pull Request #21332

There is an error showed in a pop-up when I try to upgrade my 3.3.6 Joomla website:

ERROR:

Invalid AJAX data: Fatal error: Cannot access protected
property JException::$code in
/home/MYSITE/public_html/WEBSITE-FOLDER/templates/MY_index_template/error.php
on line 14

I guess there is 404 page url on line 14 :
(between line 13-17):

defined( '_JEXEC' ) or die( 'Restricted access' );
if (($this->error->code) == '404') {
header('Location: index.php?option=com_content&view=article&id=90');
exit;
} 

Thanks in advance.

Tom Tom's user avatar

Tom Tom

3,6835 gold badges34 silver badges40 bronze badges

asked Mar 9, 2015 at 10:19

demyr's user avatar

For me it was the WindowsHosting/websitefolder/tmp that was not allowing the files to be written. File name created but 0 bytes size.
SOLUTION:
I have ftp access, downloaded and uploaded the update package to that tmp folder and clicked on the update again. This time it ran successfully.
Incidentally was going from 3.4.1 to 3.4.5

answered Oct 28, 2015 at 15:23

Novice user's user avatar


#23343

Error: Invalid AJAX data

Posted in ‘Akeeba Backup for Joomla!’

This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Akeeba Backup version

n/a

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 2Mb, please upload it on your server and post a link to it.

Description of my issue:

I clicked too early :-(

It’s Joomla 3.4.3
Akeeba 4.4.0
php 5.4.36-1~dotdeb.1

I get this error:

The backup operation has been halted because an error was detected.
The last error message was:

Invalid AJAX data: (HTML containing script tags)

Please click the ‘Analyse Log’ button below have Akeeba Backup analyse its log file for further information.

Attached the log file.

Jan

I believe that your webstats folder has several thousands of files. Since you have a limited amount of available PHP memory (64Mb – and 20 of that is already used by Joomla! and Akeeba Backup’s code) trying to list its contents will result in an error.

Normally you needn’t back up this directory. Just go to Akeeba Backup, Files and Directories Exclusion and exclude this directory from the backup. If for some reason you do need to back it up let me know; we can use a different directory scanner engine which could work in your case.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Yes! That’s it.

Thanks a lot.

Jan

You’re welcome :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

  1. Offline

    Bshenuy

    Недавно здесь

    Регистрация:
    02.06.2011
    Сообщения:
    7
    Симпатии:
    0
    Пол:
    Мужской

    Привет
    у меня зависает резервное копирование на одном файле
    как исправить?
    Прикрепил картинку з ошибкой

    Вложения:

    • 000.png

      000.png
      Размер файла:
      12 КБ
      Просмотров:
      6

  2. Offline

    eLig

    Пользователь

    Регистрация:
    27.05.2009
    Сообщения:
    103
    Симпатии:
    7
    Пол:
    Мужской

    Попробуй поставить последнюю стабильную версию Akeeba.
    Возможно указано ограничение на размер файлов см. настройки Akeeba.

  3. Offline

    Bshenuy

    Недавно здесь

    Регистрация:
    02.06.2011
    Сообщения:
    7
    Симпатии:
    0
    Пол:
    Мужской

    Операция резервного копирования была приостановлена, поскольку была обнаружена ошибка.
    Последним сообщением об ошибке было:

    Invalid AJAX data:

    Пожалуйста, нажмите на кнопку ‘Посмотреть журнал’ для просмотра журнала Akeeba Backup и получения дополнительной информации.

    Перед тем, как писать на форум поддержки для получения помощи, пожалуйста, прочтите сначала Руководство Пользователя.

  4. Offline

    eLig

    Пользователь

    Регистрация:
    27.05.2009
    Сообщения:
    103
    Симпатии:
    7
    Пол:
    Мужской

    В настройки Akeeba поставь галку «Использовать фреймы (IFRAMEs) вместо технологии AJAX».

  5. Offline

    Bshenuy

    Недавно здесь

    Регистрация:
    02.06.2011
    Сообщения:
    7
    Симпатии:
    0
    Пол:
    Мужской

    Поставил
    результат

    Операция резервного копирования была приостановлена, поскольку была обнаружена ошибка.
    Последним сообщением об ошибке было:

    Invalid AJAX data:

    Пожалуйста, нажмите на кнопку ‘Посмотреть журнал’ для просмотра журнала Akeeba Backup и получения дополнительной информации.

    Перед тем, как писать на форум поддержки для получения помощи, пожалуйста, прочтите сначала Руководство Пользователя.

  6. Offline

    mailmoney

    Пользователь

    Регистрация:
    14.01.2009
    Сообщения:
    241
    Симпатии:
    19
    Пол:
    Мужской

    Думаю нужно избавится от этих компонентов бэкапов. может быть напишем инструкцию и скрипт как будет делаться всё железно.
    Моё предложение — инструкция по добавлению скрипта архивирования всего сайта в крон, и скрипта делающего бэкап базы.

Поделиться этой страницей


Форумы Joomla! CMS

Во время выбрасывания исключений Laravel проверяет, есть ли в классе исключения метод render(), если да, то он использует метод этого исключения для отображения результата. Если вы не хотите полагаться на глобальную систему отлова исключений Laravel, то можете вернуть ответ в JSON напрямую из контроллера.

Laravel пытается преобразовать исключения в читаемый формат в зависимости от ожидаемого от клиента формата ответа, будь то HTML или JSON, сначала он преобразует различные форматы исключений в простое исключение типа HttpException:

if ($e instanceof ModelNotFoundException) {
    $e = new NotFoundHttpException($e->getMessage(), $e);
} elseif ($e instanceof AuthorizationException) {
    $e = new HttpException(403, $e->getMessage());
} elseif ($e instanceof TokenMismatchException) {
    $e = new HttpException(419, $e->getMessage());
}

И только затем он обрабатывает некоторые исключения особым образом.

IlluminateHttpExceptionsHttpResponseException — это особое исключение, встроенное в Laravel. Особенность этого исключения заключается в том, что оно уже содержит шаблон ответа для клиента, поэтому Laravel просто возвращает ответ из этого исключения.

Рендеринг исключений аутентификации

Исключение аутентификации IlluminateAuthAuthenticationException обрабатывается с использованием метода unauthenticated(), который по умолчанию редиректит пользователя на URL-адрес /login для повторной аутентификации. Но, в случае, если клиент присылает заголовок Accept: application/json то будет возвращён объект в формате JSON и 401 статусом:

{"message" : "Unauthenticated."}

Конечно, Laravel не считался бы гибким фреймворком, если бы это поведение нельзя было изменить.

Рендеринг исключений при валидации

В случае, когда выбрасывается исключение типа IlluminateValidationValidationException, фреймворк перенаправляет пользователя на URL-адрес с которого пользователь делал запрос, передавая сессией список из всех ошибок валидации, и это дает вам возможность проверить, содержит ли переменная $errors любые ошибки, которые вы можете вывести на экране:

@if (count($errors) > 0)
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif

Если клиентом был запрошен формат представления — JSON, то Laravel возвращает объект с HTTP-кодом 422, который выглядит следующим образом:

{
  "message": "The given data failed to pass validation.",
  "errors": {
    "email": [
        "The email field is required.",
        "The field under validation must be formatted as an e-mail address."
    ]
  }
}

Рендеринг остальных исключений

На этом этапе все специальные исключения либо преобразуются в простое исключение HttpException, либо обрабатываются особым образом. Для остальных же исключений, Laravel сначала проверяет, какой из форматов ответа ожидает клиент: HTML или JSON, а затем, исходя из этого, действует соответствующим образом.

Как Laravel определяет какой формат ответа клиент ожидает получить?

Laravel использует метод expectedJson() класса IlluminateHttpRequest. Этот метод проверяет наличие заголовка X-Requested-With и содержит ли он значение XMLHttpRequest. Подобный заголовок устанавливается большинством структур JavaScript при AJAX запросе, и Laravel использует его, чтобы предположить, что запрос действительно является AJAX-запросом. Однако, помимо этого, Laravel также проверяет заголовок X-PJAX в запросе и просто возвращает false, если он присутствует, поскольку этот заголовок указывает на то, что ответ должен быть не в формате JSON, а в виде обычного HTML-кода.

Наконец, он проверяет заголовок Accept, в котором проверяет, ожидает ли клиент JSON в ответ.

Итак, если клиент ожидает JSON-ответ, как Laravel преобразует исключение в JSON?

Если в конфигах фреймворка, параметру app.debug задано значение true, Laravel преобразует исключение в формат JSON со следующей структурой:

{
    "message": "...",
    "file": "...",
    "line": ...,
    "trace": "..."
}

Это очень помогает во время разработки, так как это дает больше информации разработчику, для понимания того, что пошло не так во время обработки запроса. Однако, очевидно, что параметру app.debug не должно быть установлено значение true в продакшене, поскольку подобное сообщение может предоставить конфиденциальную информацию сторонним лицам. В этом случае Laravel, проверяется, является ли выброшенное исключение типом HttpException, и возвращает сообщение об ошибке в виде следующей структуры JSON:

{
    "message": "..."
}

Однако, если исключение не является подтипом HTTP, или исключения с кодом 500, Laravel просто возвращает сообщение «Server Error»:

{
    "message": "Server Error"
}

Если вы доверяете пользователям своего API, то создайте кастомное исключение типа HTTP, и они смогут получать сообщения ошибок. Иначе же Laravel возьмёт работу по защите ваших данных, скрыв фактическое сообщение исключения, и покажет только ошибку «Server Error».

Что происходит, когда ожидается ответ в формате HTML?

Сначала Laravel проверяет, есть ли у вас какие-либо представления в вашем каталоге resources/views/errors с именем кода состояния статуса ошибки, например, 404.blade.php, 500.blade.php, .... Если представление существует, то Laravel отображает его в браузере клиента.

Если такого представления не было найдено, Laravel будет использовать обработчик исключений по умолчанию, коим является обработчик от Symfony. Он отображает красивое представление с детальной информацией об исключении в случае, если app.debug включен, или «Whoops, looks like something went wrong.», если режим отладки отключён.

Изменение стандартного формата отображения ошибок

Иногда возникает необходимость в изменении формата отображения ошибок валидации при AJAX-запросе. По умолчанию Laravel показывает ошибки в формате:

{
    "message":"The given data was invalid.",
    "errors": {
        "name": ["The name field is required."],
        "email": ["The email must be a valid email address.", "The email must be at least 4 characters."]
    }
}

Если вам нужно кастомизировать этот ответ, и сделать какой-то нестандартный вывод, к примеру, вывод только списка сообщений, без группировки их под соответствующими ключами, то нужно изменить файл app/Exceptions/Handler.php:

// проверяем, что это AJAX запрос, или ответ требуется вернуть в формате JSON
if(($request->ajax() && !$request->pjax()) || $request->wantsJson()) {
    // проверяем, что исключение является типом ошибки валидации
    if($exception instanceof ValidationException) {
        return new JsonResponse([
            'success' => false,
            'errors' => IlluminateSupportArr::collapse($exception->errors()),
            'message' => $exception->getMessage()
        ], 422);
    }

    return new JsonResponse([
        'success' => false,
        'message' => $exception->getMessage()
    ], 422);
}

В результате этой модификации, ответ будет выглядеть:

{
    "success":false,
    "errors": [
        "The name field is required.",
        "The email must be a valid email address.",
        "The email must be at least 4 characters."
    ],
    "message":"The given data was invalid."
}

Аналогично этому вы можете кастомизировать индивидуально любой тип исключения. Или же, можете написать общий обработчик для всех исключений. Типа того, что был добавлен несколько ниже обработки исключений валидации:

return new JsonResponse([
    'success' => false,
    'message' => $exception->getMessage()
], 422);

Резюме

В этой статье я подробно рассказал, как работает отлов и обработка исключений в Laravel. Был показан весь их жизненный цикл, и объяснена работа каждого из них. Так же, был продемонстрирован пример того, как отобразить кастомный ответ в JSON при ошибках валидации, и различных HTTP-статусах. Эта статья появилась после написания первой статьи о создании кастомных страниц при исключениях, где были рассмотрены примеры отлова исключений и соответствующех их индивидуальной обработки. После прочтения этих статей вы можете сказать, что знаете об обработке исключений в Laravel почти всё.

Hi all,

I am using version, 1.10.3, of DataTables and have a question about the ajax.data option. I have looked at the examples in the documentation. (https://datatables.net/reference/option/ajax.data) But, I can’t seem to clear the Invalid JSON primitive error. Here is a sample of my code:

$(‘#grdTournamentList’).DataTable({
‘ajax’: {
‘type’: ‘POST’,
‘contentType’: ‘application/json; charset=utf-8’,
‘url’: ‘@Url.Action(«MethodAByName», «QuickStart»)’,
‘data’: {«name»:»jun»},
‘dataType’: ‘json’,
‘dataSrc’: »,
//’cache’: false
}
});

I’ve attempted every variation of the {name:jun} data parameter that I can think of and it always fails with the same error, Invalid JSON Primitive Error: name. I know my web method call is working correctly, because I can call it as follows using jQuery.ajax() directly. Please note this is a ASP.NET MVC application.

$.ajax({
type: ‘POST’,
contentType: ‘application/json; charset=utf-8’,
url: ‘@Url.Action(«MethodAByName», «QuickStart»)’,
data: ‘{name:»juni»}’,
dataType: ‘json’,
success: function (data, textStatus, jqWHR) {
debugger;
alert(data);
}
});

I recognize that in my «successful» ajax example, the data is being passed in as a JSON string. Anyway of mimicking that behavior with the ajax.data option from the Datatable?

Thank you in advance.

This is a tutorial on how to handle errors when making Ajax requests via the jQuery library. A lot of developers seem to assume that their Ajax requests will always succeed. However, in certain cases, the request may fail and you will need to inform the user.

Here is some sample JavaScript code where I use the jQuery library to send an Ajax request to a PHP script that does not exist:

$.ajax({
     url: 'does-not-exist.php',
     success: function(returnData){
         var res = JSON.parse(returnData);
     },
     error: function(xhr, status, error){
         var errorMessage = xhr.status + ': ' + xhr.statusText
         alert('Error - ' + errorMessage);
     }
});

If you look at the code above, you will notice that I have two functions:

  • success: The success function is called if the Ajax request is completed successfully. i.e. If the server returns a HTTP status of 200 OK. If our request fails because the server responded with an error, then the success function will not be executed.
  • error: The error function is executed if the server responds with a HTTP error. In the example above, I am sending an Ajax request to a script that I know does not exist. If I run the code above, the error function will be executed and a JavaScript alert message will pop up and display information about the error.

The Ajax error function has three parameters:

  • jqXHR
  • textStatus
  • errorThrown

In truth, the jqXHR object will give you all of the information that you need to know about the error that just occurred. This object will contain two important properties:

  • status: This is the HTTP status code that the server returned. If you run the code above, you will see that this is 404. If an Internal Server Error occurs, then the status property will be 500.
  • statusText: If the Ajax request fails, then this property will contain a textual representation of the error that just occurred. If the server encounters an error, then this will contain the text “Internal Server Error”.

Obviously, in most cases, you will not want to use an ugly JavaScript alert message. Instead, you would create an error message and display it above the Ajax form that the user is trying to submit.

JQuery 3.0: The error, success and complete callbacks are deprecated.

Update: As of JQuery 3.0, the success, error and complete callbacks have all been removed. As a result, you will have to use the done, fail and always callbacks instead.

An example of done and fail being used:

$.ajax("submit.php")
  .done(function(data) {
      //Ajax request was successful.
  })
  .fail(function(xhr, status, error) {
      //Ajax request failed.
      var errorMessage = xhr.status + ': ' + xhr.statusText
      alert('Error - ' + errorMessage);
})

Note that always is like complete, in the sense that it will always be called, regardless of whether the request was successful or not.

Hopefully, you found this tutorial to be useful.

Понравилась статья? Поделить с друзьями:
  • Error internet unrecognized scheme
  • Error internet timeout warframe
  • Error internet sec cert revoked
  • Error internet name not resolved warframe что делать
  • Error internet incorrect handle state