•  
      request #7079 NPE in TuleapRepositoryConnector.doRefreshProject
    Infos
    #7079
    Marc-Andre Laperle (markz3)
    2016-09-23 05:54
    2014-06-18 19:20
    7096
    Details
    NPE in TuleapRepositoryConnector.doRefreshProject
    Using Eclipse 4.4
    Mylyn Tasks Connector: Tuleap 2.0.0.I20140527-0713
    Mylyn Task List 3.12.0.v20140605-1718

    I created a query for a custom report called "My Report". It worked at first, I could see the results. I'm not sure when it started hapenning but after a few days (restarting Eclipse, closing/opening projects) I get this NPE when I right-click > Synchronize on the query.

    java.lang.NullPointerException
    at org.tuleap.mylyn.task.core.internal.repository.TuleapRepositoryConnector.doRefreshProject(TuleapRepositoryConnector.java:615)
    at org.tuleap.mylyn.task.core.internal.repository.TuleapRepositoryConnector.refreshProject(TuleapRepositoryConnector.java:597)
    at org.tuleap.mylyn.task.core.internal.repository.TuleapRepositoryConnector.performReportOrCustomQuery(TuleapRepositoryConnector.java:330)
    at org.tuleap.mylyn.task.core.internal.repository.TuleapRepositoryConnector.performQuery(TuleapRepositoryConnector.java:292)
    at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.synchronizeQuery(SynchronizeQueriesJob.java:312)
    at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.synchronizeQueries(SynchronizeQueriesJob.java:269)
    at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.run(SynchronizeQueriesJob.java:201)
    at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeRepositoriesJob.updateQueries(SynchronizeRepositoriesJob.java:187)
    at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeRepositoriesJob.run(SynchronizeRepositoriesJob.java:142)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

    I would try to contribute a fix for the issue myself but I haven't found the source code. The code available at https://github.com/sbegaudeau/mylyn.tasks/tree/tuleap_master looks outdated as the method where the NPE happens doesn't exist.
    Mylyn
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Firas BACHA (fbacha)
    Stage
    Empty
    Closed
    2016-09-15
    Attachments
    Empty
    References
    References list is empty

    Follow-ups

    User avatar
    I haven't used the connector for a while, but if I see the problem again, I'll let you know. Thanks!
    User avatar

    For some reasons, when restarting eclipse, sometimes the projects related to a tracker become null (maybe they're not loaded from configuration?). I think the best approach would be to investigate why this save/load config doesn't always work, but for now I've added a small commit that manually refreshed the project config when the projects are null. If you're still interested in debugging it @markz3, the source code is now available here

    User avatar
    I still can't find a way to perfectly reproduce it, but it's still happening from time to time. I was thinking about adding a check for NPE and refresh the projects if they're null, but still I'll try to find out why this is happening in the first place.

    • Assigned to changed from Laurent Delaigue (ldelaigue) to None
    User avatar
    "So if you could tell us any hint or idea about when exactly things started to go wrong, it's be a great help!
    - Did you work offline?
    - Did you crash your eclipse once? (this may erase the local server configuration in some cases)"

    I did work offline a few times between the moment I created the query and the moment I noticed the bug. I've also had multiple complete shutdowns of my computer while Eclipse was running so that could also explain it. I'll try to narrow it down and come back to you. Thank you!
    User avatar
    • Summary
      -NPE in TuleapRepositoryConnector.doRefreshProject ee 
      +NPE in TuleapRepositoryConnector.doRefreshProject 
    User avatar
    • Summary
      -NPE in TuleapRepositoryConnector.doRefreshProject 
      +NPE in TuleapRepositoryConnector.doRefreshProject ee 
    User avatar
    Hi, and thank you for reporting this issue!

    - The code will be available soon on Github, sorry for the inconvenience. The former repo we used for the 1.* version is outdated and deprecated.
    - As a workaround, you can try and create a new query on the same project. This should correctly refresh your configuration.

    I don't understand for the moment how your configuration got lost, but it's important that we understand how this happens, because clearly we missed something here.

    To give more context: We recently solved an issue related to tuleap servers with lots of public projects. In such cases, the creation of the task repository was veeery long because we retrieved the configuration of every accessible project.
    Now, the configuration of a project is loaded only when a query is created for this project.
    So if you could tell us any hint or idea about when exactly things started to go wrong, it's be a great help!
    - Did you work offline?
    - Did you crash your eclipse once? (this may erase the local server configuration in some cases)

    • Assigned to changed from None to Laurent Delaigue (ldelaigue)
    • CC list set to Firas BACHA (fbacha)