I
it-law-man

  • Oct 23, 2024
  • Joined Jan 18, 2023
  • 1 best answer
  • KevinTheJedi When attempting this fix I am getting a 500 error after refreshing the webpage. Just want to make sure that im supposed to replace what was previously in that section of uaoth2.php with what you've provided?
    Reverting the changes back in the _plugin table immediately lets me load the helpdesk. Gotta be something wrong with my oauth2.php im guessing.

    osTicket Version v1.18 (724de45)
    Web Server Software Apache/2.4.41 (Ubuntu)
    MySQL Version 8.0.39
    PHP Version 8.1.22

    Edit: Fixed this by downloading a fresh phar and redoing the process! Now just getting AUTHENTICATE failed when saving. So going to read further up as I'm pretty sure this was mentioned before

    Edit2: I'm just going to take a nap. I spelled the email wrong when I tried deleting and recreating. All is working now. Thanks as always!

  • KevinTheJedi
    No we were using centos and now we are on ubuntu. I actually found the solution. At some point all the files in the attachments folder with upper and lower case files were all put into the same folder rather than their respective folders with the correct casing. I moved all files into their appropriate folders and all is good now. I'm guessing that when i used winSCP to copy the attachments folder from the old one it just merged the two folders into one.

    As always thanks for the tips!

    Link to the forum post I found that led me to this solution.
    https://forum.osticket.com/d/102481-migrate-attachments-from-db-to-filesystem-ioerror-unable-to-open-for-reading

    • Had the same issue when migrating from AWS to Azure. Upper and lower case files were somehow in the same folder even though i did a direct copy. Moving them to the forrect case sensitive folder was the fix for me as well! Thanks

    • KevinTheJedi

      The only relevant log is in the osticket logs and it tells you what file could not be accesses

      What is weird is it seems like its 50/50 at this point what attachments are able to be seen/downloaded. I was planning on just leaving it but turns out it wont let you reply to a ticket where the attachment cant be loaded.

      Also selinux is not installed

      Edit: Just came accross this log as well. Not sure if related or not

      • So I just finished moving everything over to a new server and everything is operational but accessing attachments on the filesystem, both screenshots and files from before the migration. New attachments are working fine.

        Things ive tried:

        1. I've put the old attachments folder in the same location as the old server and even given it 777 with www-data as the user:group.
        2. increased the file size limit to 32Mb
        3. Made sure plugin is enabled and updated. even from the settings page dropdown it says filesystem:/path/to/attachments

        Some things ive noticed but im not knowledgeable enough to piece anything together. when looking in the ost_file table I can see allllll the old attachments and the dk is showing F (from googling this means im good to go on the filesystem?) and I can even see the file name of the files I am unable to open from within the ticket as well as their hashed name. So I would think it has to be some weird permission issue or somehow when clicking the file in the ticket it is going to the wrong place in the attachments folder?

        Any help would be appreciated here! Thanks!

        Edit: after trying 100s of attachments on previous tickets I found a couple that are working... Seems to only be screenshots though, haven't found an actual file that will download. Not sure what this means

        • korali

          Did you ever end up finding a reporting tool that works in 1.17? In the same boat here with software-mods still being down. I have a copy of it from when we used it before but it hasn't worked in a while.

        • ntozier
          No other security and I did update the plugin. I actually found the issue. There was a post I came across when researching an issue with emails with aliases coming into the default department. The fix for that was to make some changes to the "class.mailfetch.php" and "api.tickets.php" I reverted those back to default and issue immediately resolved itself. However now we are having the issue again where a bunch of random tickets are getting put into the wrong department. Luckily I can create filters for 99% of them. I can provide the 4 files (2 original and 2 modified) if anyone wants to take a look at what could have possibly fixed the other issue and broke attachments.

        • fixpc82
          Do you have rewrite enabled for apache?

          You will also have to add "AllowOverride All" to the main Apache config

        • I should also mention I checked the database and the attachments are showing non 0 values for size. I had seen that issue a few times when searching for a resolution to this. Also selinux is disabled.

          • Running into an issue where attachments downloaded or viewed in the helpdesk web interface are not viewable. When
            downloading an attachment or any file type we get an error along the lines of the file being corrupt. This started happening after the upgrade to 1.17.2

            Same goes for pasting in a screenshot into the body of the ticket.

            However, the recipient sees the pasted in image in the email they receive. As well as being able to open attached files of all types just fine. It is only when trying to open files downloaded from the helpdesk.

            I've checked permissions on the attachments folder and even set it recursively to 777 as well as chowning apache:apache whereas before we had the owner set as an osticket user account on the centOS box this is all running on.

            My initial thoughts were permissions or maybe no free space on the VM but those both check out.

          • If this is for an email that already existed before oauth2. you may have to delete and re add. That's what I had to do.

            • KevinTheJedi
              Lol I still get lost in their endless portals even being in them 8 hours a day!

              Anyways thanks for all the help!

              For anyone stumbling upon this later on. I still am unable to remove GA from these accounts, but I think that's more of an issue with MS and maybe our tenant specifically.

            • KevinTheJedi
              Ahhhhh. Idk if this is tenant specific but I had to get there through enterprise apps (which shows app registrations as well). Only then did it show a security tab and the option to grant on behalf.

              • KevinTheJedi
                So weird. I had already done that and it still pops up asking for consent. Maybe I'm missing an api permission or something?

                • KevinTheJedi
                  So I had tried that, and since the account is not an admin I used my personal admin account to grant access and that is when I got that error. I gave the service account global admin and it seems to be working. However when removing global admin it stops working. Is GA really needed? Seems a bit excessive.

                  Most important thing is I now have a working solution so no more panicking about basic auth going away lol.

                  Thanks for all teh help with this!

                  • it-law-man
                    Made a new app registration and that seems to be working. Now It's giving an email mismatch. Do these accounts needd temp admin? Could do a pim role if needed. but tried to consent from my account with GA and getting this

                    • Here is what is filled out on the authorization page

                    • Trying to get OAuth2 setup before our basic is depreciated. And I'm running into an issue where when I submit the configuration with all the app registration information for an email account it just hangs on the loading screen. Opening dev tools showing a oauth2:msmail with a status code of 500. The setup worked fine from the main plugin getting admin accounts to use OAuth2. I even tried making a new app registration and no luck. Not sure where to start troubleshooting here.