-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unable to export the tickets #5303
Comments
Check the permissions of the temp directory. PHP will create a file in the temp directory to write the data and then reads from the file to send the data to the browser for download or to email the file to you. Maybe PHP is struggling to read from the file or is struggling to check the status of the export? Cheers. |
I have the exact same issue but a little different, for me this only happens from Agent Panel->Users->Organizations->Choose Any Organization->Tickets->Export. I am also on 1.14.1 upgraded from 1.12.5 (it worked fine in that version). Is there a fix or temporary workaround to this? It is the end of the month and we need to generate customer billing info based on per-organization basis. Pls kindly help! Thanks in advance! |
Is this the correct temp folder that you meant? I already gave all permissions If I'm wrong, where can I find the temp directory? Thanks. |
No one here can tell you where your temp folder is located. You would have to consult your php.ini to locate your temp directory. If you do not know where your php.ini is located, then you can create a file in your website root folder (give it any name you want, like delme.php) and in it put Then browser to it with with your web browser. It should tell you where your php.ini is located as well as where your temp folder is located. |
Do you see any errors in your Apache error logs, PHP error logs, browser console, or osTicket System Logs? Also, have you checked your permissions for PHP’s temp directory? Cheers. |
Answers to your questions:
210.22.112.50 - - [27/Dec/2019:11:03:28 +0800] "GET /scp/orgs.php?_pjax=%23pjax-container HTTP/1.1" 200 12174 "https://support.jetservices.com.cn/scp/users.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
So I am very lost as to what is causing this. Pls help! Cheers! |
Thank you for your help to find temp directory. I already found the path in php.ini file as below I had given all the permission to all the temp directories as stated in the path "/var/cpanel/php/sessions/ea-php72" and I had set all the file and directories as default permissions, but the problem still doesn't solve. What else can I do next? Thanks. |
Your screen shot does not appear to show the temp directory... The temporary directory directive is |
Also set my upload_tmp_dir = "/tmp", rebooted server as well. Double checked persmission for /tmp and it still is the 777 permission but the problem STILL exists unfortunately. I seriously do not think it's the permissions since a previous version of osTicket worked flawlessly....... |
The exporter was completely changed in 1.14.x. In 1.12.x and below the system builds the export and pushes the data directly to the browser for download all in the same request which was obviously not too great as it caused timeouts on large exports. In 1.14.x the system builds the export in a temp file in the background and makes repeated AJAX requests every X seconds to check the status of the export, if the export takes a long time the system sends the export in an email to the address associated with your Agent account. It also has a button on the "Please Wait" window to email the export if you don’t feel like waiting. With all this being said, the issue seems to stem from when it checks the status of the export (at least in the cases we have been given debug results). When it checks the status it first checks the session for an export by a particular ID (each export has its own unique ID in case you have multiple exports going on) and a file within that particular export. If it has both of those things it tries to create an Exporter object and return it to the subsequent methods. So it might be the system having issues saving the export object in the session, or maybe having issues constructing an Export object in PHP, or having issues reading the temp file, or having issues locking/checking the lock on the temp file, etc. We can’t really tell yet as we can’t replicate the issue in house. If you or anyone can provide any helpful debug information we can hopefully get this resolved. I’d start by going to Cheers. |
ok thx, I will try turn on debug info inside php.ini as well to see if it throws anything onscreen., |
I'm sorry for the wrong file but I already found the temp directory which is '/tmp' and it had all the permissions = 777 but the problem doesn't solve too. For the debug info you said earlier, I did the var_dump and get the results as below: From the screenshot above, I think the export object is already there right? Thanks. |
So, for your case you can see You can see if the Exporter instance is being loaded by putting Cheers. Edit: If
If you are having issues with the |
Thanks for the reply sir. I did what you said to put var_dump($exporter); in include/class.export.php on line 576 but nothing appear on the screen. Then, I try place the code on the other line which is on line 565 and this is the output Plus, I also tried to put on line 588 just to make sure is it true that the exporter is NULL and this is the output on screen. So, both show that the exporter was NULL. I think the first possibility that you mention is the issue which is the system cannot load the Exporter instance (via Exporter::load($id)). But, this is just my thought, please correct me if I'm wrong. I'm not sure that the var_dump($exporter) output is true because I put in other line. If it is true, what I need to do to fix the issue? In your previous reply you give the solution for the second possibility only. Besides, I had tried your code for
I try it just to see if something happen but nothing different thing appears. So, what can I do next, sir? I'm looking forward for your reply and really appreciate your help. Happy New Year and Thanks. |
Now you should go to the Cheers. |
Hello sir, I did what you told me to do. And this is the output: a) var_dump($id, $info, $class); on line 572 b) put var_dump($ex); after } catch (Exception $ex) { Why both of them got almost the same output and only the second parameter was different and change in every try? What can you conclude from this output? Thanks. |
Hello sir. Regarding to my previous reply, what can I do next sir? Looking forward to hear your idea of solution to fix this issue! Thanks. |
Hello sir, is it there is no other solution that you could give to me? Does the labels mean there is nothing you could help to solve this issue? I really need to use this function. Looking forward for any solution from osTicket team on this issue. I hope osTicket team could debug this problem and release the new version that fix those issues because I realized that's not just me who got this problem. There's many people facing the same problem on the latest version of osTicket v1.14.1 that you can see from discussion in osTicket forum. Appreciate to hear your updates soon. Thanks. |
The labels just mean we do not know the cause and we need to review this again. We cannot replicate this issue in house so it's very difficult to make a patch. We will continue to assist you in debugging the issue as best as we can.
First, remove all previous
.. before/above Cheers. |
I did remove all the previous var_dump statements and put those code in the Exporter : : load(): But, it doesn't solve the issue and the output was still the same: So, how is it sir? Thanks. |
Of course it’s not going to address the issue, this is just the debugging stage. We have to figure out what the issue is before we can fix it. Above
I have a feeling your PHP is having issues reading the file. Note: Cheers. |
Okay, after I put those code, this is the output: What means by that var_dump output? Thanks. |
As I suspected your PHP is having issues reading the file as Cheers. |
But, as i told you before. I already gave all 777 for the permission to the tmp files and folders as below (this is the /tmp directory): What other permission that I need to give? Did I gave the wrong permission? Thanks. |
As per PHP documentation:
So I’d start by checking the safe mode restrictions to ensure this is not the culprit. Cheers. |
How can I check the safe mode restriction, sir? Thanks. |
You’ll have to read PHP's documentation on this available on their website. You can also try adding Cheers. |
I have exact the same issue as you. |
@DavidCommandeur See the following comment for a patch: Cheers. |
Hi @JediKev Tried it but still the white bar. I'am getting keen on fixing this problem. I find it strange that the export problem only occures when making an export in the scp: All other exports and even the 'user tab -> user directory -> export' I can make an export without a problem. what are the differences? for your information, see thread: https://forum.osticket.com/d/96770-organization-ticket-export-not-working/2 |
@DavidCommandeur Okay so your issue is different than the OP’s issue. OP’s issue is due to Shared Host restrictions. Your issue deals with the organization export specifically (which is due to undefined method) which I’m currently working on. A fix will be posted to the thread you linked on the Forum when I’m done. Cheers. |
Yes that's the case. The list of users or the list of organizations itself I can export, like all other exports. thanks in advance for the upcomming fix. |
@JediKev @Dav1dNL https://github.com/osTicket/osTicket/pull/5418/files this has also fixed my issue, thx so much guys!!! @umisuhanarahman Hope everything works out for you too. |
I do still have the problem. following the instrunctions I get the error in php.log [01-Dec-2020 20:49:40 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /xx/include/class.http.php:86) in /xx/include/class.http.php on line 94 from the lines it is referring to the following: when commenting out this does disappear and no errors are shown. Following the advices above: commenting out the email send, does not help, still nothing is shown. I have included into htaccess Any idea what could be the problem? |
Are you using a shared host or hosting provider? Or is this a server hosted in-house? Cheers. |
shared host. |
If you already have that patch applied, please follow the instructions listed here and if that doesn't work follow the instructions listed here. If it still doesn't work you need to contact your host to see how to get around their specific restrictions. Cheers. |
Thank you @JediKev unfortunately everything already tested without getting it fixed. Will try to get some ideas on what could be wrong here. cheers |
Yea, your host definitely has some weird, custom restrictions. Contacting them would be in your best interest. Cheers. |
Hello All, I'm facing exactly the same problem and I would like to know if there is any update about this issue? Thanks, |
I would encourage you to read this comment above and try the steps listed. Cheers. |
Thanks for your prompt reply and sorry for not mention before that I read all this post and I tried everything that is suggested here and in the linked posted and the only thing that works was comment the lines at ajax.tickets.php file: But seems that commenting this lines will cause a side effect that the email is never send, so I'm looking for a more better workaround or even a final solution for this problem. Is there any other solution? Thanks once again. |
Are you using a shared host? If so, I’d recommend contacting your hosting provider for further assistance. Cheers. |
Yep sir. I'm using a shared host and I already tried to contact them but they couldn't figure out find the problem. Do you mid if you can tell me what exactly I should ask to them? Also I build a environment inside the customer network using webmin and I got exactly the same issue, anyway for this environment I have full access, so is there any test that I can do? Cheers. |
I would start here and make sure you’ve tried everything listed in that comment and all 7 comments directly following it. It has honestly been a while since I’ve touched on this issue but I explained in this comment what I found when using a shared host environment that was experiencing the same issue. It was due to Output Buffering that the host intentionally disabled so I explained what I had to do to get it working in this comment. Cheers. |
Thanks a lot for your comments, I will double check everything from the scratch to make sure that I didn't missed anything. Cheers. |
Same issue here after updating to 1.15.2 from 1.12.2. Self hosted on IIS Commenting out the below fixes the issue.
Have tried this fix but no luck: #5303 (comment) EDIT: Have tested on different PHP versions. It works on 7.2, but fails on 7.3. and 7.4. Downgrading to 7.2 fixes the issue. Whether it's because my config is different in 7.2 I don't know. Any specifics I can check for? |
Server 2019 and IIS 10, PHP 7.3.19, osT 1.15.2.
For more information regarding this attempt see: |
@ntozier did you try PHP 7.2? |
@RikkiMasters no I did not. PHP 7.2 is end of life. I'm more apt to go to 7.4 (or 8 once osTicket supports it). |
@ntozier My point is it works on 7.2. So testing it would narrow down the issue to a 7.3 change. |
we are using Plesk to host this ticket system. I change 2 php files as per this post Also I am using PHP 7.3 |
I am also facing the same issue when newly installed with below configured. Task, Org user export working, but ticket export is not working.Version | v1.15.4 (6bd7884) — Up to date |
I am not able to replicate this issue using v1.15.4, Apache, MySQL 8, and PHP 7.4. Please review all logs on your server for any related errors (general server logs, webserver error logs, PHP error logs, MySQL/MariaDB error logs, osTicket System Logs, Browser Console logs, etc.). The empty white box is typically indicative of either AJAX issues or a fatal PHP error that should be logged somewhere. I think it's the latter as this is most common with export issues. Cheers. |
In logs we can see only Also no mod security errors found. As per Hosted Server Message: Looks like coding issue as per their message |
Same issue Server 2019 A short-term fix that worked was commenting out the following sections in the ajax.tickets.php file:
|
I think I found the problem!. It has something to do with the session storage between requests. I tried exporting tickets using a browser speed regulation (thus making the requests slower) and worked fine. That gave me a hint. So, in order to fix this, I edited the class.export.php, function ack(). This is my version: function ack() {
// Register the export in the session
self::register($this);
// IT GOES HERE
session_write_close();
// Flush response / return export id and check interval
Http::flush(201, json_encode(['eid' =>
$this->getId(), 'interval' => $this->getInterval()]));
// Phew... now we're free to do the export
// NOT HERE!: session_write_close(); // Release session for other requests
ignore_user_abort(1); // Leave us alone bro!
@set_time_limit(0); // Useless when safe_mode is on
// Ask the queue to export to the exporter
} Hope it helps! |
Server Information
osTicket Version v1.14.1 (f1e9e88) — Up to date
Web Server Software Apache
MySQL Version 10.2.29
PHP Version 7.3.12
Hello, can you assist me how to solve this. I cannot export my tickets to csv because when I click on the export button the pop up goes blank just like the picture above. What I need to do to able to export the ticket csv file?
My console show this "Failed to load resource: the server responded ajax.php/export/10kUeB/check:1 with a status of 404 () "
Plus, I checked that there is no error in any logs.
I also check all the permission for class.export.php file.
On the other hand, I already tried use the export function in the v1.12.5 which is the older version and the export function run smoothly but it won't do the same in this latest version.
I hope anyone could help me to solve this. Thank you in advance!
The text was updated successfully, but these errors were encountered: