Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

New ticket induces Error 500

Hello,

I initially appended my message at the end of http://www.osticket.com/forum/discussion/87292/open-a-new-ticket-always-returns-500-internal-server-error-invalid-csrf-token-on-ticket-response before I notice it was an old thread with less chance to be viewed. So, I open this new one.

Well, I'm with osTicket 1.9.14 (entire system info at bottom).

Just after a ticket submission, my customers (and my test shows the same
thing) obtain an error 500 about
http://<my-domain>/support/open.php.

Here is the exact message (just masked my domain name):
The <my_domain> page isn’t working.
<my_domain> is currently unable to handle this request.
HTTP ERROR 500

Nothing in osTicket's System log visible from http://<my_domain>/support/scp/logs.php.

Here is what I see in http://<my_domain>/support/error_log:

[01-Mar-2017
06:32:10 America/Montreal] PHP Fatal error:  Uncaught exception
'Exception' with message 'No such backend registered' in
/home/biiip/public_html/sfy/support/include/class.file.php:693
Stack trace:
#0 /home/biiip/public_html/sfy/support/include/class.file.php(111): FileStorageBackend::getInstance(Object(AttachmentFile))
#1 /home/biiip/public_html/sfy/support/include/class.file.php(115): AttachmentFile->open()
#2 /home/biiip/public_html/sfy/support/include/class.file.php(133): AttachmentFile->sendData(false)
#3 /home/biiip/public_html/sfy/support/include/class.mailer.php(373): AttachmentFile->getData()
#4 [internal function]: Mailer->{closure}(Array)
#5
/home/biiip/public_html/sfy/support/include/class.mailer.php(379):
preg_replace_callback('/cid:([\\w.-]{32...', Object(Closure), '<div
style="dis...')
#6
/home/biiip/public_html/sfy/support/include/class.email.php(168):
Mailer->send('admin.alerts@sh...', 'New Ticket Aler...',
'<h2>Hi Admin,</...', Array)
#7
/home/biiip/public_html/sfy/support/include/class.email.php(178):
Email->sen in
/home/biiip/public_html/sfy/support/include/class.file.php on line 693

And here is the access log for the domain just before the error:
78.218.191.79
- - [01/Mar/2017:06:29:52 -0500] "GET /support/ajax.php/config/client
HTTP/1.1" 200 69 "http://<my_domain>/support/open.php"
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/56.0.2924.87 Safari/537.36"
78.218.191.79 - -
[01/Mar/2017:06:29:53 -0500] "GET
/support/ajax.php/draft/ticket.client.9b41d9ff842e HTTP/1.1" 205 33
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:29:53 -0500] "POST
/support/ajax.php/draft/ticket.client.9b41d9ff842e HTTP/1.1" 200 17
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:30:03 -0500] "POST
/support/ajax.php/draft/2119 HTTP/1.1" 200 2
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:30:47 -0500] "GET
/support/ajax.php/form/help-topic/10 HTTP/1.1" 200 26
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:31:13 -0500] "POST
/support/ajax.php/draft/2119 HTTP/1.1" 200 2
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:31:23 -0500] "POST
/support/ajax.php/draft/2119 HTTP/1.1" 200 2
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:31:33 -0500] "POST
/support/ajax.php/draft/2119 HTTP/1.1" 200 2
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:31:43 -0500] "POST
/support/ajax.php/draft/2119 HTTP/1.1" 200 2
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:31:44 -0500] "POST
/support/open.php HTTP/1.1" 200 16318
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:31:45 -0500] "GET
/support/ajax.php/draft/ticket.client.9b41d9ff842e HTTP/1.1" 205 33
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:31:45 -0500] "POST
/support/ajax.php/draft/ticket.client.9b41d9ff842e HTTP/1.1" 200 17
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:31:55 -0500] "POST
/support/ajax.php/draft/2120 HTTP/1.1" 200 2
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"
78.218.191.79 - - [01/Mar/2017:06:32:03 -0500] "POST
/support/open.php HTTP/1.1" 500 -
"http://<my_domain>/support/open.php" "Mozilla/5.0 (Windows NT
6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87
Safari/537.36"

The ticket is well submitted, but because of this
error, we (customers) think it's not. So, some give up and some insist
doing I have a lot of duplicate tickets...

Do you have an idea of the reason why ?

--
Server Information
osTicket Version     v1.9.14 (8b927a0)
Upgrade — v1.9.15 is available
Web Server Software     Apache/2.4.25 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
MySQL Version     5.5.54
PHP Version     5.6.30
PHP Extensions
gdlib     Used for image manipulation and PDF printing
imap     Used for email fetching
xml     XML API
xml-dom     Used for HTML email processing
json     Improves performance creating and processing JSON
mbstring     Highly recommended for non western european language content
phar     Highly recommended for plugins and language packs
fileinfo     Used to detect file types for uploads
PHP Settings
cgi.fix_pathinfo     "1" is recommended if AJAX is not working
date.timezone     America/Montreal
Database Information and Usage
Schema     biiip_sfyost (localhost)
Schema Signature     b26f29a6bb5dbb3510b057632182d138
Space Used     257.15 MiB
Space for Attachments     243.19 MiB
Installed Language Packs
français, langue française (French) — fr_FR   Verified
Version: 145919, Built: Mon, 28 Mar 16 20:25:30 +0000
Tagged:

Comments

  • Please upgrade to the latest in the 1.9 tree or current (1.10) and retest and let us know if you are still having an issue.
  • edited March 2
    OK, I'll do it as soon as possible. Does the 1.10 is stable enough for production environment ?

    EDIT: Forget my question! I read "1.10 - Latest Stable Release" on http://osticket.com/download :)
  • edited March 4
    Hello,

    Upgraded to osTicket 1.10 successfully!

    In admin board (dashboard / informations), I see some red triangle icons (warnings?):
    - intl: Highly recommended for non western european language content
    - APCu: Improves overall performance
    - Zend Opcache: Improves overall performance

    - and one about French lang pack (it sounds to be the most recent official one):

    français, langue française (French)
    — 
    fr — include/i18n/fr.phar
    Version: 145919, for version v1.9
    Built: Mon, 28 Mar 16 20:25:30 +0000

    Also, I didn't succeeded to log some test users using their username (passed using email only).

    About the error for which I opened this thread : it remains the same (page with error 500 while a new ticket is well created; but the user seems it's not by the way)... I've no time to take a look in the different logs right now, but I'll do a new test asap and will report the result here...

  • edited March 5
    OK, just did a new test some minutes ago and still the error 500 after ticket creation.

    1) osTicket System Logs (log level being WARN) : nothing!

    2) error_log in osTicket directory:
    [05-Mar-2017 16:42:08 UTC] PHP Fatal error:  Uncaught exception 'Exception' with message 'No such backend registered' in /home/<domain>/public_html/sfy/support/include/class.file.php:712
    Stack trace:
    #0 /home/<domain>/public_html/sfy/support/include/class.file.php(109): FileStorageBackend::getInstance(Object(AttachmentFile))
    #1 /home/<domain>/public_html/sfy/support/include/class.file.php(113): AttachmentFile->open()
    #2 /home/<domain>/public_html/sfy/support/include/class.file.php(131): AttachmentFile->sendData(false)
    #3 /home/<domain>/public_html/sfy/support/include/class.mailer.php(485): AttachmentFile->getData()
    #4 [internal function]: Mailer->{closure}(Array)
    #5 /home/<domain>/public_html/sfy/support/include/class.mailer.php(491): preg_replace_callback('/cid:([\\w.-]{32...', Object(Closure), '<h2>Hi Support ...')
    #6 /home/<domain>/public_html/sfy/support/include/class.email.php(178): Mailer->send(Object(Staff), 'New Ticket Aler...', '<h2>Hi Support ...', Array)
    #7 /home/<domain>/public_html/sfy/support/include/class.email.php(188): Email->send(Objec in /home/<domain>/public_html/sfy/support/include/class.file.php on line 712

    3) main access_log:
    78.218.191.79 - - [05/Mar/2017:12:03:16 -0500] "GET /support/ HTTP/1.1" 200 5508 "https://www.google.fr/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
    78.218.191.79 - - [05/Mar/2017:12:03:23 -0500] "GET /support/open.php HTTP/1.1" 200 6952 "http://<domain>.com/support/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
    78.218.191.79 - - [05/Mar/2017:12:03:31 -0500] "GET /support/ajax.php/form/help-topic/10 HTTP/1.1" 200 10594 "http://<domain>.com/support/open.php" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
    78.218.191.79 - - [05/Mar/2017:12:03:55 -0500] "POST /support/open.php HTTP/1.1" 500 - "http://<domain>.com/support/open.php" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"

    Do you have an idea about the cause of this issue?

    --
    EDIT : Tried with log level DEBUG and no more info. Just this weird stack trace talking about missing backend about attachment, while my test message has no attachment at all.
  • Did you upgrade the language pack?
    Did you upgrade any plugins that you were running?
  • edited March 5
    Previously, I had the French language pack and the filesystem attachment plugin (in disabled state), but I removed both after the upgrade to see if it changed something... But no, still error 500!

    Also (maybe related), some months ago, when I installed this filesystem attachment plugin, I remember I disabled it afterward because the migration script (the one moving the attachments from the database to files system on disk) didn't worked... Don't know what were the errors, but it created some sub-directories in the directory I pointed to be the attachments one... And more funny (or not), since this date it remains two subdirs I can't delete through FTP. Since I'm a little in constant emergency with my own developments, I never digged. If it can help, I could try to log through Telnet/SSH, and see if I can entirely remove this old attachment folder (so, currently empty with just two subdirs) changing ownership. What do you think? Do you think this orphan "locked" directory could have some relationship with my current issue even if this plugin was disabled during upgrade and is now removed.

    Also, about language, looking deeper in System Logs, I can read seven lines like this during upgrade-time:
    DB Error #1146
    [SELECT A1.* FROM `sfyost_translation` A1 WHERE (A1.`lang` = 'en_US' AND A1.`type` = 'phrase')] Table 'dedeecat_sfyost.sfyost_translation' doesn't exist

    ---- Backtrace ----
    #0 (root)/include/mysqli.php(204): osTicket->logDBError('DB Error #1146', '[SELECT A1.* FR...')
    #1 (root)/include/class.orm.php(3133): db_query('SELECT A1.* FRO...', true, true)
    #2 (root)/include/class.orm.php(3180): MySqlExecutor->execute()
    #3 (root)/include/class.orm.php(1771): MySqlExecutor->getArray()
    #4 (root)/include/class.orm.php(1815): ModelInstanceManager->{closure}()
    #5 (root)/include/class.orm.php(1794): CallbackSimpleIterator->next()
    #6 (root)/include/class.orm.php(1803): CallbackSimpleIterator->rewind()
    #7 (root)/include/class.orm.php(1463): CallbackSimpleIterator->valid()
    #8 (root)/include/class.orm.php(1480): CachedResultSet->fillTo(9223372036854775807)
    #9 (root)/include/class.orm.php(1489): CachedResultSet->asArray()
    #10 (root)/include/class.translation.php(899): CachedResultSet->getIterator()
    #11 (root)/include/class.translation.php(920): CustomDataTranslation::getTranslation('en_US')
    #12 (root)/include/class.list.php(396): CustomDataTranslation::translate('37eec2fe8f75003...')
    #13 (root)/include/class.list.php(209): DynamicList->getLocal('name_plural')
    #14 (root)/include/class.list.php(524): DynamicList->getPluralName()
    #15 [internal function]: DynamicList::getSelections()
    #16 (root)/include/class.forms.php(567): call_user_func(Array)
    #17 (root)/include/class.forms.php(575): FormField::allTypes()
    #18 (root)/include/class.forms.php(1016): FormField::getFieldType('text')
    #19 [internal function]: FormField->getImpl(Object(DynamicFormField))
    #20 (root)/include/class.dynamic_forms.php(596): call_user_func_array(Array, Array)
    #21 (root)/include/class.dynamic_forms.php(1339): DynamicFormField->__call('getImpl', Array)
    #22 (root)/include/class.dynamic_forms.php(1339): DynamicFormField->getImpl(Object(DynamicFormField))

  • Hello,

    Finally deleted the old attachment directory I talk about above. It doesn't change anything on the Error 500 issue on new ticket.

    What's the next step? Do you think I should renew the upgrade process to 1.10 over itself (reuploading setup directory, then running upgrade.php)?
  • Tried to investigate. Here is what I saw:

    Well, since the backtrace reported in error_log says this:
    [05-Mar-2017 16:42:08 UTC] PHP Fatal error:  Uncaught exception
    'Exception' with message 'No such backend registered' in
    /home/<domain>/public_html/sfy/support/include/class.file.php:712

    I temporary patched the function at line 712 of class.file.php like this:
        static function getInstance($file) {

            /* TEMP START */
            $f = fopen("tmp.txt","w");
            fwrite($f, $file->getName());
            fclose($f);       
            /* TEMP END */
       
            if (!isset(self::$registry[$file->getBackend()]))
                throw new Exception("No such backend registered");

            $class = self::$registry[$file->getBackend()];
            return new $class($file);
        }

    Then, in tmp.txt, I can read the concerned file:
    "powered-by-osticket.png"

    So what, does it mean there's no backend to handle PNG? What's your advice to go forward?

  • It sounds to me like your DB is configured for Files on the Filesystem (or some place else).  So it tries to use that file and it crashews since it has no back end to handle the connection.
  • edited March 6
    Hmm, thanks for the track, but why it complains about an osTicket standard file (powered-by-osticket.png) with no relationship with attachment... Also, my tickets were without any attachment and I well receive the attachments when there're one (even when it's about PNG images).

    So, how could I check and fix this? What would be the next step to go forward?
  • edited March 8
    OK, seems to be solved, but I would like to be sure it's OK around.

    I searched for the concerned file ("powered-by-osticket.png") in the database and found it in the "file" table. Its "bk" (I guess meaning "backend") fields said "F" (I guess "File"), so I changed it to what I supposed to be the right one for database : "D".

    All of this is empirical, but it works! So, done for this specific case... But I would like to ask you a question : I see others records in this "file" table with "bk" field as "F" (eg. see attached screenshot). Should I change all to "D" or does it was a problem for "powered-by-osticket.png" only?

    snap_0004242
    heberger image

  • I would try to run the migration tool to import all images into the DB, but yeah if the image (and other files are actually in the DB) just updating them to D ought to fix your issue.
  • OK, Neil, thanks. I keep in mind the possible necessity to run the migration tool if it persists and I'm going to change all the F to D for now.
  • Very welcome.

    Should I mark this as resolved, or do you want me to keep it open so you can report back in a few days how its going?
  • edited March 20
    This exact same thing happened to me, and without this thread, I doubt I would have figured it out. I installed the plug-in for external storage, migrated a few images, then decided I disliked the plug-in (because of the way it stores things in the filesystem, i.e. in randomly-named folders and files), so I disabled the plug-in. 

    I didn't even think about the migrated images, and the system didn't warn me at all when disabling the plug-in (would be nice to see a message about "Have you migrated any images back in?" or something). So then we started getting the same error 500. Manually editing the file database table and switching any "F" values to "D" solved the problem.

    thanks, 0xFF!

    -rob.
Sign In or Register to comment.