Plugin fails to read data

Issue #18 resolved
Tomi Erlih created an issue

Hi,

We’re currently started to evaluate your “API Tokens for Jira” plugin, make use of it in our Jira Data Center instance. We installed the plugin, and the “Create” button in the Profile exists, the installation (or even disable/enable) seems fine, when a user tries to create a token, it works only half way. So the token is created, but when you close the pop-up window nothing happens (the token is not listed in the profile). I checked directly in the database and the token is in fact in the “TOKENS” table. But when I check Jira logs, I see it throwing an error, when data is being read. The two important hints from the exception for you are:

There was a SQL exception thrown by the Active Objects library:
….
org.postgresql.util.PSQLException: ERROR: column "username" does not exist

I have attached the full exception stack trace as a file.

We run Jira version: 8.8.1 (DataCenter) and DB is PostgreSQL 9.6, installed version of the plugin is 1.1.6.

Can you provide some guidance why we are running into this issue and which additional data is needed by you to analyze the issue?

Comments (19)

  1. Roma Bubyakin [Wombats Corp]

    Hello Tomi,

    Thanks a lot for creating a ticket!

    I will try to reproduce and fix it as soon as possible.

    Things that could help with problem identification from your side:

    1. check if the issue is reproducible on v1.1.5 (you can download it here)
    2. provide result of the following query on the DB:
    select column_name, data_type, character_maximum_length
    from INFORMATION_SCHEMA.COLUMNS where table_name = 'AO_5D4005_TOKEN';
    

    All of them not strictly required, but may speed up the investigation.

    Regards, Roman

  2. Tomi Erlih reporter

    Hi Roman,

    Downgrade to 1.1.5 did solve the problem, ti seems. But I need to check if everything works now. I’ll provide the info you requested by tomorrow, if you still need it.

    Thank you for the swift reply!

    Best regards,
    Tomi

  3. Roma Bubyakin [Wombats Corp]

    Thank you, Tomi!

    Your response helped to localize the problem.

    Seems that nothing more is needed from your side.

    I’ll come back soon with a fix.

    Regards, Roman

  4. Tomi Erlih reporter

    Hi Roman,

    Yes, I can confirm that with the provided 1.1.7 version, the exception is not thrown and the tokens are properly displayed.

    Best regards,
    Tomi

  5. Tomi Erlih reporter

    Hi Roman,

    So I can also confirm, that the tokens work in general with that version - 1.1.7.

    I did detect one more problem, but I’m pretty sure I should submit this separately. I’m not able to revoke tokens. Not via single token revoke and also not via “revoke all”. There’s no execption thrown. I don’t have time to revert to 1.1.5 again, to check if there this also didn’t work.

  6. Roma Bubyakin [Wombats Corp]

    Okey, I got it.

    Then will try to reproduce it on my own and will keep you posted.

  7. Stephan Breitrainer

    I’ve identified the query, if this helps and still is relevant:

    2020-07-09 08:28:38,763+0000 http-nio-8080-exec-4 anonymous 508x4696x1 - /rest/agile/1.0/board 2 ms "SELECT "LAST_USAGE","DESCRIPTION","ID","TOKEN","CREATED","KEY","USERNAME" FROM public."AO_5D4005_TOKEN" WHERE lower(USERNAME) = ? ORDER BY "ID"" {1=myusername}
    org.postgresql.util.PSQLException: ERROR: column "username" does not exist
    

    The query has to be something like:

    SELECT "LAST_USAGE","DESCRIPTION","ID","TOKEN","CREATED","KEY","USERNAME" FROM public."AO_5D4005_TOKEN" WHERE lower("USERNAME") = 'myusername' ORDER BY "ID";
    

  8. Roma Bubyakin [Wombats Corp]

    Thank you, Stephan

    The problem already identified and fixed, I will release new version in few minutes.

    The root cause is related to the following Atlassian issue https://ecosystem.atlassian.net/browse/AO-315 marked as Won't Fix.

    Generally, Atlassian’s ORM (Active Objects) cannot perform lower(column_name) operation correctly on Postgres DB.

  9. Roma Bubyakin [Wombats Corp]

    Hi Tomi,

    Thank you once more for reporting tokens removing issue!

    It’s related to the same bug and already fixed.

    Regards, Roman

  10. Tomi Erlih reporter

    Hi Roman,

    I now installed the published 1.1.7 version and can confirm that the fix works for us. Perfect.

    May I ask you to apply the same fix and publish the “same” plugin for Confluence? It has exactly the same issue in the 1.1.6 version?

    Best regards,
    Tomi

  11. Clinton Zofnas (US - IFS)

    Hi Roma,

    Thank you for the quick fix. I will apply 1.1.7 today and let you know.

    Best regards, Clint

  12. Log in to comment