0

我正在运行 SonarQube 5.3.1 实例,并且在访问权限模板页面时收到 NullReferenceException:

2016.03.21 16:27:34 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://dev-zh-05:9000/api/permissions/search_templates
java.lang.NullPointerException: null
    at org.sonarqube.ws.WsPermissions$SearchTemplatesWsResponse$TemplateIdQualifier$Builder.setTemplateId(WsPermissions.java:6643) ~[sonar-ws-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.permission.ws.template.SearchTemplatesAction.buildDefaultTemplatesResponse(SearchTemplatesAction.java:110) ~[sonar-server-5.3.1.jar:na]
    at org.sonar.server.permission.ws.template.SearchTemplatesAction.buildResponse(SearchTemplatesAction.java:98) ~[sonar-server-5.3.1.jar:na]
    at org.sonar.server.permission.ws.template.SearchTemplatesAction.doHandle(SearchTemplatesAction.java:84) ~[sonar-server-5.3.1.jar:na]
    at org.sonar.server.permission.ws.template.SearchTemplatesAction.handle(SearchTemplatesAction.java:76) ~[sonar-server-5.3.1.jar:na]
    at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:85) ~[sonar-server-5.3.1.jar:na]

...

在我看来,默认权限模板的配置存在错误 - 我该如何调试?我可以删除默认权限模板并以某种安全方式重新创建它吗?

这是调用前的调试级摘录:

2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11188 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11188 Executing server side cursor SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY [users].id) AS _row_num, * FROM [users] WHERE ([users].[id] = N'39')) AS t WHERE t._row_num BETWEEN 1 AND 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12542 created by (SQLServerStatement:11188)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8101 created by (SQLServerResultSet:12542)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11189 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11189 Executing server side cursor SELECT * FROM [groups]  INNER JOIN [groups_users] ON [groups].id = [groups_users].group_id WHERE ([groups_users].user_id = 39 ) 
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12543 created by (SQLServerStatement:11189)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8102 created by (SQLServerResultSet:12543)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11190 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11190 Executing server side cursor SELECT role FROM [group_roles] WHERE (resource_id is null and (group_id is null or group_id in(N'1',N'2'))) 
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12544 created by (SQLServerStatement:11190)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8103 created by (SQLServerResultSet:12544)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11191 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11191 Executing server side cursor SELECT * FROM [user_roles] WHERE ([user_roles].user_id = 39) 
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12545 created by (SQLServerStatement:11191)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8104 created by (SQLServerResultSet:12545)
2016.03.21 16:27:32 DEBUG web[http] GET /permission_templates | time=94ms
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11192 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11192 Executing server side cursor SELECT 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12546 created by (SQLServerStatement:11192)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11193 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11193 Executing server side cursor SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY [users].id) AS _row_num, * FROM [users] WHERE ([users].[id] = N'39')) AS t WHERE t._row_num BETWEEN 1 AND 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12547 created by (SQLServerStatement:11193)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8105 created by (SQLServerResultSet:12547)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11194 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11194 Executing server side cursor SELECT * FROM [groups]  INNER JOIN [groups_users] ON [groups].id = [groups_users].group_id WHERE ([groups_users].user_id = 39 ) 
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12548 created by (SQLServerStatement:11194)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8106 created by (SQLServerResultSet:12548)
2016.03.21 16:27:32 DEBUG web[http] GET /api/l10n/index?locale=en_US&ts=2016-03-21T14%3A58%3A59%2B0000 | time=62ms
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11195 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11195 Executing server side cursor SELECT 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12549 created by (SQLServerStatement:11195)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11196 created by (ConnectionID:17 ClientConnectionId: 9dbb6d44-adb4-4694-86d7-593fcc1761fa)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11196 Executing server side cursor SELECT 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12550 created by (SQLServerStatement:11196)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11197 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11198 created by (ConnectionID:17 ClientConnectionId: 9dbb6d44-adb4-4694-86d7-593fcc1761fa)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11197 Executing server side cursor SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY [users].id) AS _row_num, * FROM [users] WHERE ([users].[id] = N'39')) AS t WHERE t._row_num BETWEEN 1 AND 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11198 Executing server side cursor SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY [users].id) AS _row_num, * FROM [users] WHERE ([users].[id] = N'39')) AS t WHERE t._row_num BETWEEN 1 AND 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12551 created by (SQLServerStatement:11198)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8107 created by (SQLServerResultSet:12551)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12552 created by (SQLServerStatement:11197)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8108 created by (SQLServerResultSet:12552)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11199 created by (ConnectionID:17 ClientConnectionId: 9dbb6d44-adb4-4694-86d7-593fcc1761fa)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11199 Executing server side cursor SELECT * FROM [groups]  INNER JOIN [groups_users] ON [groups].id = [groups_users].group_id WHERE ([groups_users].user_id = 39 ) 
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11200 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11200 Executing server side cursor SELECT * FROM [groups]  INNER JOIN [groups_users] ON [groups].id = [groups_users].group_id WHERE ([groups_users].user_id = 39 ) 
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12553 created by (SQLServerStatement:11199)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8109 created by (SQLServerResultSet:12553)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12554 created by (SQLServerStatement:11200)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8110 created by (SQLServerResultSet:12554)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11201 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11201 Executing server side cursor SELECT 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11202 created by (ConnectionID:18 ClientConnectionId: 8ee8e54b-baa5-4aaa-9ad9-fd51fcc85eb2)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11202 Executing server side cursor SELECT 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12555 created by (SQLServerStatement:11202)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12556 created by (SQLServerStatement:11201)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11203 created by (ConnectionID:18 ClientConnectionId: 8ee8e54b-baa5-4aaa-9ad9-fd51fcc85eb2)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11203: calling sp_cursorprepexec: PreparedHandle:0, SQL:SELECT

    d.id, d.user_id as "userId", d.name, d.description, d.column_layout as "columnLayout",
    d.shared, d.is_global as "global", d.created_at as "createdAt", d.updated_at as "updatedAt"

    FROM dashboards d
    INNER JOIN active_dashboards ad on d.id=ad.dashboard_id
    LEFT OUTER JOIN users u on u.id=ad.user_id
    WHERE d.is_global=1

        AND u.login=@P0

    ORDER BY order_index ASC        
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12557 created by (SQLServerPreparedStatement:11203)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8111 created by (SQLServerResultSet:12557)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11204 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11204: calling sp_cursorprepexec: PreparedHandle:0, SQL:SELECT gr.role
        FROM group_roles gr
        INNER JOIN groups_users gu on gu.group_id=gr.group_id
        INNER JOIN users u on u.id=gu.user_id
         WHERE  u.login=@P0
          and gr.resource_id is null 
        UNION
        SELECT gr.role
        FROM group_roles gr
        WHERE gr.group_id IS NULL AND gr.resource_id IS NULL
        UNION
        SELECT ur.role
        FROM user_roles ur
        INNER JOIN users u on u.id=ur.user_id
         WHERE  u.login=@P1
          and ur.resource_id is null                
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11205 created by (ConnectionID:18 ClientConnectionId: 8ee8e54b-baa5-4aaa-9ad9-fd51fcc85eb2)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11205 Executing server side cursor SELECT 1
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12558 created by (SQLServerStatement:11205)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12559 created by (SQLServerPreparedStatement:11204)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8112 created by (SQLServerResultSet:12559)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11206 created by (ConnectionID:18 ClientConnectionId: 8ee8e54b-baa5-4aaa-9ad9-fd51fcc85eb2)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11206: calling sp_cursorprepexec: PreparedHandle:0, SQL:SELECT

    d.id, d.user_id as "userId", d.name, d.description, d.column_layout as "columnLayout",
    d.shared, d.is_global as "global", d.created_at as "createdAt", d.updated_at as "updatedAt"

    FROM dashboards d
    INNER JOIN active_dashboards ad on d.id=ad.dashboard_id
    LEFT OUTER JOIN users u on u.id=ad.user_id
    WHERE d.is_global=1

        AND u.login IS NULL

    ORDER BY order_index ASC
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12560 created by (SQLServerPreparedStatement:11206)
2016.03.21 16:27:32 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8113 created by (SQLServerResultSet:12560)
2016.03.21 16:27:32 DEBUG web[http] GET /api/navigation/global | time=156ms
2016.03.21 16:27:32 DEBUG web[http] GET /api/navigation/settings | time=156ms
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11207 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11207 Executing server side cursor SELECT 1
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12561 created by (SQLServerStatement:11207)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11208 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11208 Executing server side cursor SELECT 1
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12562 created by (SQLServerStatement:11208)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11209 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11209: calling sp_cursorprepexec: PreparedHandle:0, SQL:select cq.uuid
    from ce_queue cq
    where cq.status='PENDING'
    and not exists(
    select 1
    from ce_queue cq2
    where cq.component_uuid=cq2.component_uuid and cq2.status <> 'PENDING'
    )

    order by cq.created_at asc, cq.id asc
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12563 created by (SQLServerPreparedStatement:11209)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8114 created by (SQLServerResultSet:12563)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11210 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11210 Executing server side cursor SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY [users].id) AS _row_num, * FROM [users] WHERE ([users].[id] = N'39')) AS t WHERE t._row_num BETWEEN 1 AND 1
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12564 created by (SQLServerStatement:11210)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8115 created by (SQLServerResultSet:12564)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11211 created by (ConnectionID:19 ClientConnectionId: 2d9f8fbe-9cbb-413f-a663-53540c0a1f84)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11211 Executing server side cursor SELECT * FROM [groups]  INNER JOIN [groups_users] ON [groups].id = [groups_users].group_id WHERE ([groups_users].user_id = 39 ) 
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12565 created by (SQLServerStatement:11211)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8116 created by (SQLServerResultSet:12565)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11212 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11212 Executing server side cursor SELECT 1
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12566 created by (SQLServerStatement:11212)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11213 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11213: calling sp_cursorprepexec: PreparedHandle:0, SQL:SELECT gr.role
        FROM group_roles gr
        INNER JOIN groups_users gu on gu.group_id=gr.group_id
        INNER JOIN users u on u.id=gu.user_id
         WHERE  u.login=@P0
          and gr.resource_id is null 
        UNION
        SELECT gr.role
        FROM group_roles gr
        WHERE gr.group_id IS NULL AND gr.resource_id IS NULL
        UNION
        SELECT ur.role
        FROM user_roles ur
        INNER JOIN users u on u.id=ur.user_id
         WHERE  u.login=@P1
          and ur.resource_id is null                
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12567 created by (SQLServerPreparedStatement:11213)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8117 created by (SQLServerResultSet:12567)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11214 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerStatement:11214 Executing server side cursor SELECT 1
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12568 created by (SQLServerStatement:11214)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11215 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11215: calling sp_cursorprepexec: PreparedHandle:0, SQL:SELECT

    id, name, kee, description, key_pattern AS keyPattern, created_at AS createdAt, updated_at AS updatedAt

    FROM permission_templates

    ORDER BY UPPER(name), name
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12569 created by (SQLServerPreparedStatement:11215)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8118 created by (SQLServerResultSet:12569)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11216 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11216: calling sp_cursorprepexec: PreparedHandle:0, SQL:SELECT ptu.template_id as templateId, ptu.permission_reference as permission, count(u.login) as count
    FROM users u
    INNER JOIN perm_templates_users ptu ON ptu.user_id=u.id
    AND ptu.template_id in
     (  
      @P0
     ) 
     WHERE  u.active = 1 
    GROUP BY ptu.template_id, ptu.permission_reference        
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12570 created by (SQLServerPreparedStatement:11216)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8119 created by (SQLServerResultSet:12570)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11217 created by (ConnectionID:16 ClientConnectionId: 4a295b70-d2e3-40a1-8f07-5e081489f838)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerStatement] SQLServerPreparedStatement:11217: calling sp_cursorprepexec: PreparedHandle:0, SQL:SELECT count(name) as count, permission, templateId
    FROM
    (SELECT g.name as name, ptg.permission_reference as permission, ptg.template_id as templateId
    FROM groups g
    INNER JOIN perm_templates_groups ptg ON ptg.group_id=g.id
    UNION
    -- Add Anyone group permission
    SELECT @P0 as name, ptg.permission_reference as permission, ptg.template_id as templateId
    FROM perm_templates_groups ptg
     WHERE  ptg.group_id IS NULL 
    ) groups
     WHERE  groups.templateId in
      (
        @P1
      ) 
    GROUP BY groups.permission, groups.templateId                
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSet] SQLServerResultSet:12571 created by (SQLServerPreparedStatement:11217)
2016.03.21 16:27:33 DEBUG web[c.m.s.j.i.SQLServerResultSetMetaData]  SQLServerResultSetMetaData:8120 created by (SQLServerResultSet:12571)
2016.03.21 16:27:34 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://dev-zh-05:9000/api/permissions/search_templates
java.lang.NullPointerException: null
    at org.sonarqube.ws.WsPermissions$SearchTemplatesWsResponse$TemplateIdQualifier$Builder.setTemplateId(WsPermissions.java:6643) ~[sonar-ws-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.permission.ws.template.SearchTemplatesAction.buildDefaultTemplatesResponse(SearchTemplatesAction.java:110) ~[sonar-server-5.3.1.jar:na]
    at org.sonar.server.permission.ws.template.SearchTemplatesAction.buildResponse(SearchTemplatesAction.java:98) ~[sonar-server-5.3.1.jar:na]
    at org.sonar.server.permission.ws.template.SearchTemplatesAction.doHandle(SearchTemplatesAction.java:84) ~[sonar-server-5.3.1.jar:na]
    at org.sonar.server.permission.ws.template.SearchTemplatesAction.handle(SearchTemplatesAction.java:76) ~[sonar-server-5.3.1.jar:na]
    at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:85) ~[sonar-server-5.3.1.jar:na]
    at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source) ~[na:na]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_51]
    at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:425) [jruby-complete-1.7.9.jar:na]
    at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:292) [jruby-complete-1.7.9.jar:na]
    at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:44) [jruby-complete-1.7.9.jar:na]
4

1 回答 1

1

这个问题被证明是相当迟钝的,只是在分析一个新项目后通过不同的崩溃才发现:

2016.03.22 08:08:39 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVOdJvs_j75QquHAjPe8
org.sonar.server.computation.component.VisitException: Visit of Component {key=deviniteJs:master,type=PROJECT} failed
    at org.sonar.server.computation.component.VisitException.rethrowOrWrap(VisitException.java:44) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:42) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.step.ApplyPermissionsStep.execute(ApplyPermissionsStep.java:72) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:39) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:72) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) [sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) [sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-5.3.1-SNAPSHOT.jar:na]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_51]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_51]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_51]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [na:1.8.0_51]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_51]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_51]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]
Caused by: java.lang.IllegalStateException: At least one default permission template should be defined
    at org.sonar.db.permission.PermissionRepository.getApplicablePermissionTemplateKey(PermissionRepository.java:200) ~[sonar-db-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.db.permission.PermissionRepository.applyDefaultPermissionTemplate(PermissionRepository.java:172) ~[sonar-db-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.db.permission.PermissionRepository.applyDefaultPermissionTemplate(PermissionRepository.java:168) ~[sonar-db-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.step.ApplyPermissionsStep.execute(ApplyPermissionsStep.java:80) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.step.ApplyPermissionsStep.access$000(ApplyPermissionsStep.java:42) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.step.ApplyPermissionsStep$1.visitProject(ApplyPermissionsStep.java:65) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:71) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:52) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:40) ~[sonar-server-5.3.1-SNAPSHOT.jar:na]
    ... 14 common frames omitted

调查 PermissionRepository.getApplicablePermissionTemplateKey 表明在手动数据库迁移期间错误地删除了属性“sonar.permission.template.default”。

添加具有默认值“default_template”的属性解决了该问题。

于 2016-03-22T07:17:44.343 回答