We are working on migrating from a Windows server to a Debian server and are having some trouble with our knowledge base attachments not opening in the web client. Some of them open in a typical prompt, but others just open a new browser tab with a blank screen. There is also no common denominator we have been able to find between the ones that open and the ones that don't. We have looked at everything we can find online, but nothing has worked. Our live server works just fine. We are using the "Attachments on the filesystem" plugin on both servers.

Steps taken to resolve:
-Installed clean debian, php, apache, osticket(1.15.4); restored database from live server with same db name and user; same issue.
-Copied live "support" folder (renamed the osticket folder) to new server to replace the new one; same issue.
-Changed owner of "attachments" folder and all children to www-data; same issue.
-Changed permissions of "attachment" folder and all children to 777; same issue.

Current setup:
-Moved back to the new support folder, copied the "attachments" folder to it, owner is www-data and permissions are the default 755 it set when it copied over.

  • @cpstelly

    That's the problem. Windows acts differently than Linux when it comes to file storage. Linux you can have a and A directories but windows you cannot. So the problem is that the file starts with C but is in the c directory. On Linux it takes the first letter of C9D-WaCivaDDPjea5fnLislH7n_TDOMk which is uppercase C and tries to find the file in the uppercase C directory. You will need to go through and move the files to their respective directories based on their captialization. So move the C9D-WaCivaDDPjea5fnLislH7n_TDOMk file to the C directory and leave all lowercase c files in the c directory and so-on.

    Cheers.

You would need to look at each image that doesn't work and see what the common denominator is. What the error message(s) are, etc. With out logs or anything I'm not real sure how else we would be able to assist you.

Well that's the thing, I've looked for any logs that would say something about it, but I cannot find any. None of the ones I look at say anything about this. Can someone shed some light on which logs to look for? I also don't get any errors, just a blank window.

@cpstelly

It differs with each OS and each install. You need to check the general server logs, webserver error logs, PHP error logs, MySQL/MariaDB error logs, osTicket System Logs, Browser Console logs, etc. for any related errors. Please consult your OS/software documentation on how to find the location for each.

Cheers.

So I finally found, buried in the apache.log file, that one of the files in question is returning 404 for the GET call. However, there isn't any more information about why that is happening. Since all of the files and all of the folders in "attachments" are set to the same owner and permission levels, I can't figure out what the cause might be. I did not see anything related in any of the other various logs either. I don't have much experience with web servers, so I'm trying to learn as I go.

Any thoughts?

Also just to note, the file in question does in fact exist on the server. It is an Excel file and I am able to open it directly in Excel.

@cpstelly

Do you have uppercase and lowercase directories in attachments folder? (eg. A, a, B, b, etc.)

Cheers.

There are a few, yes. And now that you mention that, the 2 files I have been testing that are not opening are c and j, both of which have two folders. How should I fix this without loosing data?

Update, I replaced the attachments folder with a copy from the live server with no duplicate folders. However, once I tried to access the file in the "c" folder that was not opening, I noticed a "C" folder was created somehow. The file still does not open. There are no other duplicate folders now, but I imagine they will be created if I try to access those problem files.

@cpstelly

You should have upper and lowercase, this is good. Now, for the file not opening, what is the key for this file?

Cheers.

There are supposed to be both upper AND lowercase for the same letter? Our live Windows server doesn't have duplicates.

Are you asking me to paste the key in? I can confirm that the key is the same spelling as the live server and it does work there.

The files that do seem to open on this server do not create a duplicate attachment folder. Only the ones that are not opening.

Furthermore, the "C" folder that was created is empty. The file I tried to open is in the "c" folder.

Here is the key: C9D-WaCivaDDPjea5fnLislH7n_TDOMk

@cpstelly

That's the problem. Windows acts differently than Linux when it comes to file storage. Linux you can have a and A directories but windows you cannot. So the problem is that the file starts with C but is in the c directory. On Linux it takes the first letter of C9D-WaCivaDDPjea5fnLislH7n_TDOMk which is uppercase C and tries to find the file in the uppercase C directory. You will need to go through and move the files to their respective directories based on their captialization. So move the C9D-WaCivaDDPjea5fnLislH7n_TDOMk file to the C directory and leave all lowercase c files in the c directory and so-on.

Cheers.

What should the permissions and owner:group be set as?

@cpstelly

Ownership should be set to the webserver's user/group and permissions should be set to 775 recursively for all folders/files within attachments.

Cheers.

For LInux webserver is www-data? I've seen some people say that or apache but I don't have apache user.

@cpstelly

It can be apache, apache2, httpd, www-data, etc. It’d be best to Google the correct apache user for your Debian distro.

Cheers.

Thank you for the insight. Moving the files to the correct folders was exactly what I needed.

Write a Reply...