Menu

Different behavior running a report through UI and running report through API

ART Help
2021-02-25
2021-02-26
  • Edson Carlos Ericksson Richter

    I've a readonly database (PostgresSQL hot standby database), and I run reports over this database without issues. But when I execute using the API, very same report, with very same parameters, I get an error that I can't create temp tables in a readonly database (!!!).
    Is there a difference on the way the SQL command is executed in ART when running via API? Like "preparedStatements" or "temporary tables", etc?

    Thanks,

    Edson

     
  • Timothy Anyona

    Timothy Anyona - 2021-02-26

    I don't think there's a difference. The stacktrace attached is reporting an error from art.runreport.RunReportController, which seems to indicate the report is being run from the browser?

     
  • Edson Carlos Ericksson Richter

    It's a Java program simulating a GET request using Apache Commons HTTP API.

     
  • Timothy Anyona

    Timothy Anyona - 2021-02-26

    OK. I guess it's the same code that runs then. Could you translate the exception message to english?

     
  • Edson Carlos Ericksson Richter

    Of course, I'm so sorry.

    Message is

    "org.postgresql.util.PSQLException: ERROR: cannot create temporary or unlogged relations during recovery"

    I explain: "during recovery" is just because this is a slave server (hot standby).

    I've checked the ReportRunner code, and seems that some report types requires Scrollable Cursors/ResultSets - I'm not shure that PostgreSQL provide this feature when consuming from a hot standby server.

    Would this affect? And why when running via Art web UI this error won't happen? Would be the output format related (I'm using json as reportFormat, and I've used json also in Art web UI)?

     
  • Timothy Anyona

    Timothy Anyona - 2021-02-26

    Not sure why the difference. You could add a DEBUG logger for the ReportRunner class and see if there's any difference.

     
  • Edson Carlos Ericksson Richter

    Would you mind to guide me how can I enable a DEBUG logger? I'm not confortable with logging configuration files at all (besides working with Java since 1995, I never completely understood how this logging configurations really work - may be I need to read "Java logging for Dummies" kkkk !!!)

     
  • Timothy Anyona

    Timothy Anyona - 2021-02-26

    Hi,
    Not to worry. Actually ART has an option to add/remove loggers from the UI. Use the Configure | Loggers menu. Add a DEBUG logger for art.runreport.ReportRunner. You'll then need to edit the logger to OFF when you're done testing so that it doesn't fill your logs.

     
  • Edson Carlos Ericksson Richter

    Log attached.

     
  • Edson Carlos Ericksson Richter

    I think I've found the problem, isn't ART! Actually, this database in particular has a unlogged table "reporting.filtro_6".

    I'm so sorry for disturbing!

     
  • Edson Carlos Ericksson Richter

    Thanks for teaching me how to debug this kind of error! I hope I can use this knowledge in future to help others here :-)

     
  • Timothy Anyona

    Timothy Anyona - 2021-02-26

    Ah! That's really great to hear. Happy that the issue has been resolved.

     

Log in to post a comment.