Skip to content

Volume snapshot listing failing when originating primary pool removed #3264

Closed

Description

@DagSonsteboSB
ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • Volume snapshots in ACS4.11.2
CLOUDSTACK VERSION
  • ACS 4.11.2
CONFIGURATION
  • Any incorporating volume snapshots
OS / ENVIRONMENT
  • N/A
SUMMARY
  • Volume snapshot present as far as CloudStack and Secondary storage goes
  • Original primary storage pool ID has been removed
  • listSnapshots will fail with:
    Error: (HTTP 530, error code 9999)

2019-04-05 14:08:18,176 ERROR [c.c.a.ApiServer] (qtp788117692-312:ctx-6993074e ctx-97c28410) (logid:b9e936a0) unhandled exception executing api command: [Ljava.lang.String;@3ab4697e
java.lang.NullPointerException

STEPS TO REPRODUCE
  • As above, take volume snapshot, then delete original primary storage pool.
  • Confirm the snapshot has two entries in cloud.snapshot_store_ref - one for primary and one for image.
  • Ensure the primary pool is marked as deleted.
  • Do a listSnapshots API call against the snapshot and observe above errors.
  • Now change the snapshot_store_ref entry for primary for the snapshot in question to a non-deleted primary pool.
  • Do the listSnapshots API call again and observe this working.
EXPECTED RESULTS
  • listSnapshots returning results
ACTUAL RESULTS
  • Error as above.

Activity

  1. nvazquez commented on Apr 5, 2019

    @nvazquez
    Contributor

    Error is NullPointerException on StorageSubsystemSnapshotStrategy, as the pool is removed, this line returns an empty pool: https://github.com/apache/cloudstack/blob/4.11.2.0/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java#L976

    2019-04-05 13:48:39,507 ERROR [c.c.a.ApiServer] (qtp788117692-12:ctx-817b96c3 ctx-5c399d14) (logid:9277d33d) unhandled exception executing api command: [Ljava.lang.String;@2829384
    java.lang.NullPointerException
            at org.apache.cloudstack.storage.snapshot.StorageSystemSnapshotStrategy.canHandle(StorageSystemSnapshotStrategy.java:978)
            at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:72)
            at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:69)
            at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.bestMatch(StorageStrategyFactoryImpl.java:95)
            at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.getSnapshotStrategy(StorageStrategyFactoryImpl.java:69)
            at org.apache.cloudstack.storage.snapshot.SnapshotObject.isRevertable(SnapshotObject.java:134)
            at com.cloud.api.ApiResponseHelper.createSnapshotResponse(ApiResponseHelper.java:536)
            at org.apache.cloudstack.api.command.user.snapshot.ListSnapshotsCmd.execute(ListSnapshotsCmd.java:117)
            at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:150)
            at com.cloud.api.ApiServer.queueCommand(ApiServer.java:732)
    

    Possible workarounds without deleting the snapshot:

    • Remove the entry on snapshot_store_ref with store_role = Primary for conflicting snapshot.
    • Update the pool_id column on snapshot_store_ref for conflicting snapshot to a non-removed pool id.
  2. added this to the 4.13.0.0 milestone on May 27, 2019
  3. yadvr commented on Jun 7, 2019

    @yadvr
    Member

    @shwstppr can you pick this up?

  4. shwstppr commented on Jul 3, 2019

    @shwstppr
    Contributor

    working on this

  5. shwstppr commented on Jul 4, 2019

    @shwstppr
    Contributor

    Unable to reproduce this on the master,

    • Create disk and create snapshot for it [There are 2 entries in snapshot_store_ref]
    • Put originating primary storage pool on maintenance and try to force remove
      Error: (HTTP 530, error code 4250) Cannot delete pool Primary as there are associated non-destroyed vols for this pool
    • Destroy created disk or migrate created disk to a different primary storage
      It deletes snapshot entry from snapshot_store_ref where store_role=Primary
      Removing primary storage pool and list snapshots thereafter doesn't give NPE.

    Any pointers here @nvazquez

  6. self-assigned this
    on Jul 10, 2019
  7. modified the milestones: 4.13.0.0, 4.13.1.0 on Jul 10, 2019
  8. yadvr commented on Jul 10, 2019

    @yadvr
    Member

    @shwstppr how about if you remove the volume as well (but not its full snapshots) and then delete the primary storage pool?

  9. DaanHoogland commented on Jan 29, 2020

    @DaanHoogland
    Contributor

    @shwstppr did you abandon this? any intermediate results?

  10. shwstppr commented on Jan 30, 2020

    @shwstppr
    Contributor

    @DaanHoogland was not able to reproduce this earlier. Let me try again today

  11. yadvr commented on Jan 30, 2020

    @yadvr
    Member

    @shwstppr if nothing else, you can still follow the code where NPE was seen and make code around that defensive.

  12. yadvr commented on Feb 6, 2020

    @yadvr
    Member
  13. shwstppr commented on Feb 7, 2020

    @shwstppr
    Contributor

    @rhtyd @DaanHoogland tried to reproduce with 4.13 but couldn't

    • Created snapshot, noticed two entries in snapshot_store_ref
    select * from snapshot_store_ref\G;
    *************************** 1. row ***************************
                    id: 2
              store_id: 1
           snapshot_id: 1
               created: 2020-02-07 10:43:47
          last_updated: NULL
                job_id: NULL
            store_role: Image
                  size: 5368709120
         physical_size: 197120
    parent_snapshot_id: 0
          install_path: snapshots/2/4/0dfc98e6-af66-4636-9dac-2175c473b7b9
                 state: Destroyed
          update_count: 4
               ref_cnt: 0
               updated: 2020-02-07 10:55:48
             volume_id: 8
    *************************** 2. row ***************************
                    id: 3
              store_id: 3
           snapshot_id: 2
               created: 2020-02-07 10:56:03
          last_updated: NULL
                job_id: NULL
            store_role: Primary
                  size: 5368709120
         physical_size: 5368709120
    parent_snapshot_id: 0
          install_path: /mnt/ff714bd3-b656-38f9-a210-350e71acf93b/bc6cda75-8359-4c5b-9b7f-178dc098c7ba/c131c60d-d6eb-4f39-9d71-855089244bfa
                 state: Ready
          update_count: 2
               ref_cnt: 0
               updated: 2020-02-07 10:56:03
             volume_id: 8
    *************************** 3. row ***************************
                    id: 4
              store_id: 1
           snapshot_id: 2
               created: 2020-02-07 10:56:03
          last_updated: NULL
                job_id: NULL
            store_role: Image
                  size: 5368709120
         physical_size: 197120
    parent_snapshot_id: 0
          install_path: snapshots/2/8/c131c60d-d6eb-4f39-9d71-855089244bfa
                 state: Ready
          update_count: 2
               ref_cnt: 0
               updated: 2020-02-07 10:56:04
             volume_id: 8
    
    • Deleted volume as without deleting/migrating was not being able to delete originating primary storage
    • Deleted primary storage, primary storage entry gets removed from snapshot_store_ref
    > select * from snapshot_store_ref\G;
    *************************** 1. row ***************************
                    id: 2
              store_id: 1
           snapshot_id: 1
               created: 2020-02-07 10:43:47
          last_updated: NULL
                job_id: NULL
            store_role: Image
                  size: 5368709120
         physical_size: 197120
    parent_snapshot_id: 0
          install_path: snapshots/2/4/0dfc98e6-af66-4636-9dac-2175c473b7b9
                 state: Destroyed
          update_count: 4
               ref_cnt: 0
               updated: 2020-02-07 10:55:48
             volume_id: 8
    *************************** 2. row ***************************
                    id: 4
              store_id: 1
           snapshot_id: 2
               created: 2020-02-07 10:56:03
          last_updated: NULL
                job_id: NULL
            store_role: Image
                  size: 5368709120
         physical_size: 197120
    parent_snapshot_id: 0
          install_path: snapshots/2/8/c131c60d-d6eb-4f39-9d71-855089244bfa
                 state: Ready
          update_count: 2
               ref_cnt: 0
               updated: 2020-02-07 10:56:04
             volume_id: 8
    2 rows in set (0.00 sec)
    
    
    • List snapshots worked fine,
    > list snapshots 
    {
      "count": 1,
      "snapshot": [
        {
          "account": "admin",
          "created": "2020-02-07T10:56:02+0000",
          "domain": "ROOT",
          "domainid": "215d2545-4987-11ea-9a78-1e0021010871",
          "id": "424f92d7-298e-46ff-9c13-6cd7cc820979",
          "intervaltype": "MANUAL",
          "name": "test12",
          "physicalsize": 197120,
          "revertable": false,
          "snapshottype": "MANUAL",
          "state": "BackedUp",
          "tags": [],
          "virtualsize": 5368709120,
          "volumeid": "8b7bee30-c20b-4ed1-9a0a-fc930b1016d7",
          "volumename": "DATA-3",
          "volumetype": "DATADISK",
          "zoneid": "025f0bd8-942f-44ea-9f94-c2c7851c935a"
        }
      ]
    }
    

    Should I try with 4.11?

  14. yadvr commented on Feb 7, 2020

    @yadvr
    Member

    @shwstppr that's fine, no need. Can you however do a manual static code analysis and add defensive checks that avoid/handle potential NPEs if any:

    2019-04-05 13:48:39,507 ERROR [c.c.a.ApiServer] (qtp788117692-12:ctx-817b96c3 ctx-5c399d14) (logid:9277d33d) unhandled exception executing api command: [Ljava.lang.String;@2829384
    java.lang.NullPointerException
            at org.apache.cloudstack.storage.snapshot.StorageSystemSnapshotStrategy.canHandle(StorageSystemSnapshotStrategy.java:978)
            at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:72)
            at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:69)
            at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.bestMatch(StorageStrategyFactoryImpl.java:95)
            at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.getSnapshotStrategy(StorageStrategyFactoryImpl.java:69)
            at org.apache.cloudstack.storage.snaps
    

    Otherwise, let's close this as not reproducible.

  15. andrijapanicsb commented on Feb 7, 2020

    @andrijapanicsb
    Contributor

    @shwstppr @rhtyd The issue is still present and reproducible on both 4.11.2 and master - just tested.

    1. create snap of a volume
    2. notice on WHICH primary storage the volume (not the snap) is located (i.e. PRI2)
    3. go to DB and set the removed date on "removed" column/field in storage_pool table
    4. list snapshots via CMK and observer the issue:

    Before "deleting" storage:

    (localcloud) SBCM5> > list snapshots id=1a63b5d5-25ad-41c4-80c7-388050cbaf47
    {
    "count": 1,
    "snapshot": [
    {
    "account": "admin",
    "created": "2020-02-07T17:26:56+0000",
    "domain": "ROOT",
    "domainid": "37bbcc53-4980-11ea-952a-1e00b30107e1",
    "id": "1a63b5d5-25ad-41c4-80c7-388050cbaf47",
    "intervaltype": "MANUAL",
    "jobid": "0c23606f-7dca-463b-b0dd-39bb59ed541e",
    "jobstatus": 0,
    "name": "snap-kvm-andrija1",
    "osdisplayname": "CentOS 5.5 (64-bit)",
    "ostypeid": "37f05328-4980-11ea-952a-1e00b30107e1",
    "physicalsize": 0,
    "revertable": true,
    "snapshottype": "MANUAL",
    "state": "BackingUp",
    "tags": [],
    "virtualsize": 8589934592,
    "volumeid": "c1f9abbd-61c6-41c8-a8b2-cc04767fd557",
    "volumename": "ROOT-8",
    "volumetype": "ROOT",
    "zoneid": "6bd91d12-cad9-477b-9300-27678ce9e80f"
    }
    ]
    }

    After "deleting" the storage:

    (localcloud) SBCM5> > list snapshots id=1a63b5d5-25ad-41c4-80c7-388050cbaf47
     Error: (HTTP 530, error code 9999)

    And the same exception in logs:

    2020-02-07 17:29:46,777 DEBUG [c.c.a.ApiServlet] (qtp504527234-13:ctx-f0fb97c1) (logid:507c01c5) ===START=== 10.2.2.233 -- GET apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&command=listSnapshots&id=1a63b5d5-25ad-41c4-80c7-388050cbaf47&response=json&signature=7d%2FoaRsxGhOx1vLpqKZULO9aFTc%3D
    2020-02-07 17:29:46,785 DEBUG [c.c.a.ApiServer] (qtp504527234-13:ctx-f0fb97c1 ctx-84cdffe8) (logid:507c01c5) CIDRs from which account 'Acct[70becd07-4980-11ea-952a-1e00b30107e1-admin]' is allowed to perform API calls: 0.0.0.0/0,::/0
    2020-02-07 17:29:46,803 ERROR [c.c.a.ApiServer] (qtp504527234-13:ctx-f0fb97c1 ctx-84cdffe8 ctx-337c9a51) (logid:507c01c5) unhandled exception executing api command: [Ljava.lang.String;@772bb72a
    java.lang.NullPointerException
    at org.apache.cloudstack.storage.snapshot.StorageSystemSnapshotStrategy.canHandle(StorageSystemSnapshotStrategy.java:982)
    at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:72)
    at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:69)
    at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.bestMatch(StorageStrategyFactoryImpl.java:95)
    at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.getSnapshotStrategy(StorageStrategyFactoryImpl.java:69)
    at org.apache.cloudstack.storage.snapshot.SnapshotObject.isRevertable(SnapshotObject.java:134)
    at com.cloud.api.ApiResponseHelper.createSnapshotResponse(ApiResponseHelper.java:552)
    at org.apache.cloudstack.api.command.user.snapshot.ListSnapshotsCmd.execute(ListSnapshotsCmd.java:117)
    at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:156)
    at com.cloud.api.ApiServer.queueCommand(ApiServer.java:759)
    at com.cloud.api.ApiServer.handleRequest(ApiServer.java:583)
    at com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:310)
    at com.cloud.api.ApiServlet$1.run(ApiServlet.java:130)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
    at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:127)
    at com.cloud.api.ApiServlet.doGet(ApiServlet.java:89)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:527)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.Server.handle(Server.java:530)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
    at java.lang.Thread.run(Thread.java:748)
    2020-02-07 17:29:46,806 DEBUG [c.c.a.ApiServlet] (qtp504527234-13:ctx-f0fb97c1 ctx-84cdffe8 ctx-337c9a51) (logid:507c01c5) ===END=== 10.2.2.233 -- GET apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&command=listSnapshots&id=1a63b5d5-25ad-41c4-80c7-388050cbaf47&response=json&signature=7d%2FoaRsxGhOx1vLpqKZULO9aFTc%3D
    2020-02-07 17:29:48,072 DEBUG [c.c.a.m.AgentManagerImpl] (AgentManager-Handler-7:null) (logid:) SeqA 7-5096: Processing Seq 7-5096: { Cmd , MgmtId: -1, via: 7, Ver: v1, Flags: 11, [{"com.cloud.agent.api.ConsoleProxyLoadReportCommand":{"_proxyVmId":1,"_loadInfo":"{\n "connections": []\n}","wait":0}}] }
    2020-02-07 17:29:48,076 DEBUG [c.c.a.m.AgentManagerImpl] (AgentManager-Handler-7:null) (logid:) SeqA 7-5096: Sending Seq 7-5096: { Ans: , MgmtId: 32988352022497, via: 7, Ver: v1, Flags: 100010, [{"com.cloud.agent.api.AgentControlAnswer":{"result":true,"wait":0}}] }
    2020-02-07 17:29:48,400 DEBUG [c.c.a.ApiServlet] (qtp504527234-20:ctx-2b2cb631) (logid:56a35fa0) ===START=== 10.2.2.233 -- GET apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&command=listSnapshots&response=json&signature=Ko6ONMB%2FT3U3UQdfiytAXUOGcjw%3D
    2020-02-07 17:29:48,405 DEBUG [c.c.a.ApiServer] (qtp504527234-20:ctx-2b2cb631 ctx-8e2267f0) (logid:56a35fa0) CIDRs from which account 'Acct[70becd07-4980-11ea-952a-1e00b30107e1-admin]' is allowed to perform API calls: 0.0.0.0/0,::/0
    2020-02-07 17:29:48,421 ERROR [c.c.a.ApiServer] (qtp504527234-20:ctx-2b2cb631 ctx-8e2267f0 ctx-4b6cab92) (logid:56a35fa0) unhandled exception executing api command: [Ljava.lang.String;@5fc1e40f
    java.lang.NullPointerException
    at org.apache.cloudstack.storage.snapshot.StorageSystemSnapshotStrategy.canHandle(StorageSystemSnapshotStrategy.java:982)
    at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:72)
    at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:69)
    at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.bestMatch(StorageStrategyFactoryImpl.java:95)
    at org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.getSnapshotStrategy(StorageStrategyFactoryImpl.java:69)
    at org.apache.cloudstack.storage.snapshot.SnapshotObject.isRevertable(SnapshotObject.java:134)
    at com.cloud.api.ApiResponseHelper.createSnapshotResponse(ApiResponseHelper.java:552)
    at org.apache.cloudstack.api.command.user.snapshot.ListSnapshotsCmd.execute(ListSnapshotsCmd.java:117)
    at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:156)
    at com.cloud.api.ApiServer.queueCommand(ApiServer.java:759)
    at com.cloud.api.ApiServer.handleRequest(ApiServer.java:583)
    at com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:310)
    at com.cloud.api.ApiServlet$1.run(ApiServlet.java:130)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
    at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
    at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:127)
    at com.cloud.api.ApiServlet.doGet(ApiServlet.java:89)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:527)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.Server.handle(Server.java:530)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
    at java.lang.Thread.run(Thread.java:748)
    2020-02-07 17:29:48,433 DEBUG [c.c.a.ApiServlet] (qtp504527234-20:ctx-2b2cb631 ctx-8e2267f0 ctx-4b6cab92) (logid:56a35fa0) ===END=== 10.2.2.233 -- GET apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&command=listSnapshots&response=json&signature=Ko6ONMB%2FT3U3UQdfiytAXUOGcjw%3D

  16. andrijapanicsb commented on Feb 7, 2020

    @andrijapanicsb
    Contributor

    Alright, a bit more digging tells me this is NOT a bug - but a consequence of bad DB hacking
    As follows:

    Tested on 4.11.2 (and master)

    • this exception happens when the pool is marked as removed (has "removed" date set) AND when there is at least one reference in the snapshots_store_ref table that says a "snapshot exists on this primary storage". Similar error would probably be raised if there are volume references but pool was marked as removed. This is "when" this issue/exception happens>

    BUT

    When you go and delete a storage via ACS GUI/API (i.e. before that manually remove any volumes/VMs from this storage via ACS) - then if there are snapshots references in the snapshots_store_ref table, those references will be properly removed (i.e. whole records are deleted where store_role="Primary" and store_id=) so the user can not even get into this situation that he is left with orphaned references in snapshot_store_ref table.

    A proposed workaround for anyone facing these issues (i.e. have DB inconsistency or has hacked DB in a wrong way) is to simply remove any references from the snapshot_store_ref table

    delete from snapshot_store_ref table where store_role="Primary" and store_id=<id-of-removed-store>

    @shwstppr @rhtyd - I would propose closing this issue altogether.

  17. andrijapanicsb commented on Feb 7, 2020

    @andrijapanicsb
    Contributor

    Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions