Alpha Video Training
Results 1 to 10 of 10

Thread: Reports not working when running multiple instances

  1. #1
    Member
    Real Name
    Jmo
    Join Date
    May 2013
    Posts
    367

    Default Reports not working when running multiple instances

    So this issue has been driving me up a wall for months, I put it on the back burner while finishing up development as the system is plenty stable on a single instance, but now that full production is around the corner I am needing to figure out the solution to this issue.

    I am running multiple WAS instances on my server using always up, I can run all the instances just fine and the application works as expected except when it comes time to download/email a report generated on demand. If I have a single instance running everything works, but as soon as I start a second instance I can run the report (ie get it to display on the screen), but as when I try to click the PDF button to download (it is an HTML report) or run the xbasic code to email the report it doesn't work. Specifically when downloading and then trying to open the file it says the file is empty, and when trying to attach the pdf to the email there is no attachment. I have a feeling the issue has to do with session storage but I can't for the life of me figure out what is setup incorrectly.

    When I have multiple instances running I can go find the report file that is generated in the session storage directory (this is in the general settings pane when configuring the WAS server) and the report opens just fine so it seems when downloading/emailing the system is not able to find this location. When emailing the report I am using the e.sessionFileKey to create a blob and then saving a new file in a directory within the Webroot folder, and again this all works fine with only one instance running.

    Any thoughts on what I have setup incorrectly when it comes to the session storage? I didn't specifically setup the session storage files, in my config files for the instances it has the session storage set to "__default__" so I am assuming these session folders were generated based on that setting?

  2. #2
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,629

    Default Re: Reports not working when running multiple instances

    Do you have separate session directories for each WAS instance? That is, if you are running three instances, are there three session directories?

    I always used specific session directores, so I don't know how it works if you leave them at default. But then I always directed the reports to a specific location outside the session directory so I always knew where it was.
    Pat Bremkamp
    MindKicks Consulting

  3. #3
    Member
    Real Name
    Jmo
    Join Date
    May 2013
    Posts
    367

    Default Re: Reports not working when running multiple instances

    With the config files set to default it does seem each instance has its own session folder. The issue I am having is it seems e.fileSessionKey isn’t able to find the data needed to build the blob that I would use to create a file outside the session directory so it can be attached to emails. I assume when you download a report using the PDF button on an HTML report it is using this same fileSessionKey to retrieve the data to build the PDF file. It’s as if I need all my instances going to the same session directory but I’m pretty sure I’ve tried this before which caused login issues. Do you use confit files for your instances or just mess with the settings via the WAS server settings screen? And would you mind sharing what your session storage settings look like so I can compare?

  4. #4
    Member
    Real Name
    Jmo
    Join Date
    May 2013
    Posts
    367

    Default Re: Reports not working when running multiple instances

    Just trying to bring more attention to this thread, still unable to run more than one instance and get my application to work (now logging in won't even work with more than one instance running).

  5. #5
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,838

    Default Re: Reports not working when running multiple instances

    Exactly how are you running on multiple instances, and how are you launching the reports? How you are doing this will help lead us to the answer.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  6. #6
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,838

    Default Re: Reports not working when running multiple instances

    Also, contrary to what I see in some other posts, you can and in my experience should point all of your instances to the SAME webroot and not a 'separate folder for each'; there is no need to do that. A given user should always stay in the same instance once they have first accessed your application. Session vars are not shared between instances so if for some reason they are bouncing around between instances (e.g., because you hard code a URL to point to a particular instance, or they hit a random instance each time they refresh the browser, etc) then they will lose the values for any session vars set in the other instance.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  7. #7
    Member
    Real Name
    Jmo
    Join Date
    May 2013
    Posts
    367

    Default Re: Reports not working when running multiple instances

    Zebrahost setup the instances originally, based on Alpha's documentation it looks like it was correct. They all pointed to the same webroot folder (still do), the folders I am referring to are session storage folders. Each instance is pointed to its own internal IP (Zebrahost private IPs). I am launching HTML reports which work fine in browser, it is only once you click the PDF button or try to send the PDF report using xbasic (e.sessionFileKey) that it doesn't work (no report gets emailed and the downloaded PDF is blank). I can see the report being created in the session storage folder pertaining to the old config files though so it seems the WAS is unable to locate the file using the e.sessionFileKey and therefore can't generate the report to download/send.

    I don't know if I have fixed the problem but I re-downloaded the WAS and re-setup the config files for 4 instances and now it is running. However, chances are it isn't working properly being I don't have the instances tied to individual IPs (which the Alpha documentation says to do), so likely this is just working because it is being treated as a single instance (ie I am not getting the benefit of running multiple instances or the load balancer). However, I'm not sure how to check the performance to see if what I have done has actually fixed the issue properly.

  8. #8
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,629

    Default Re: Reports not working when running multiple instances

    You should tell Alpha your scenario, and ask them why? Why guess when you can just ask for the answer? This is one of those cases that are not everyday use-case, you need an expert view to accommodate your issue. Remember send a test case if possible, it makes a lot of difference to the response you will get back.
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)

  9. #9
    "Certified" Alphaholic
    Real Name
    Larry Grupido
    Join Date
    May 2010
    Posts
    1,816

    Default Re: Reports not working when running multiple instances

    If you want to know if it is running multiple instances, you can delete all of the session folders in your a5webroot and see how many it recreates once it's in use again.

    You'll have to make sure the a5server is OFF when you delete them so there won't be any locked files.

  10. #10
    Member
    Real Name
    Norman K
    Join Date
    Mar 2006
    Posts
    307

    Default Re: Reports not working when running multiple instances

    Have you removed AlwaysUp from the equation, just as a test?

    I just had a weird problem crop up where my application wouldn't print PDFs (it would just hang). Everything else worked, including things like Excel exports. If I rebooted the AAS (or server itself) then things would work for 5-10 minutes and then the PDFs would hang again. Looking in the PDF queue I'd see reports of several thousand pages spooling. Even the AAS server itself eventually hung and couldn't even be restarted. I shut down AlwaysUp and ran the AAS separately and everything went back to working.

    Again, this was just a single instance but who knows?

    Good luck.

Similar Threads

  1. Error printing PDF reports with multiple instances/ports
    By monit in forum Mobile & Browser Applications
    Replies: 7
    Last Post: 10-19-2019, 02:35 PM
  2. Running multiple instances on one VPS
    By Terry in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 02-14-2010, 08:42 PM
  3. AlwaysUp and multiple instances
    By Pat Bremkamp in forum Application Server Version 9 - Web/Browser Applications
    Replies: 13
    Last Post: 12-23-2009, 05:37 PM
  4. Running multiple WAS instances
    By Pat Bremkamp in forum Application Server Version 9 - Web/Browser Applications
    Replies: 6
    Last Post: 07-01-2008, 10:29 AM
  5. Multiple Instances same window
    By gagsoft in forum Alpha Five Version 6
    Replies: 3
    Last Post: 05-12-2005, 10:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •