[jira] [Commented] (CLOUDSTACK-6938) Cannot create template from snapshot when using S3 storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-6938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14039982#comment-14039982 ] Daan Hoogland commented on CLOUDSTACK-6938: --- I submitted your patch as 736bf540e8ef759a101d221622c64f3b3c3ed425. next time please start your commit comment with the issue id (CLOUDSTACK-6938 in this case) so the link gets added automatically. I should have been looking for that as well by the way, sorry. > Cannot create template from snapshot when using S3 storage > -- > > Key: CLOUDSTACK-6938 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6938 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Snapshot >Affects Versions: 4.4.0 > Environment: KVM + S3 Secondary Storage >Reporter: Logan B >Priority: Critical > Fix For: 4.4.0 > > > When trying to create a template from a snapshot with S3 secondary storage, > the command immediately fails with a NullPointerException. > This appears to only happen when there is a pre-existing snapshot folder in > the NFS staging store. This indicates that there is something wrong with the > copy command (e.g., it's using 'mkdir' instead of 'mkdir -p'). > The issue can be worked around by deleting the existing snapshot folder on > the staging store every time you want to create a new template. This is > obviously not viable for end users. > This issue should be fixed before 4.4 ships because it should be a stupid > simple thing to correct, but completely breaks restoring snapshots for end > users. Waiting for 4.5 would be far too long for an issue like this. > 2014-06-18 21:13:54,789 DEBUG [cloud.agent.Agent] > (agentRequest-Handler-2:null) Processing command: > org.apache.cloudstack.storage.command.CopyCommand > 2014-06-18 21:13:54,789 INFO [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Determined host 172.16.48.99 corresponds to IP > 172.16.48.99 > 2014-06-18 21:13:54,797 ERROR [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Unable to create directory > /mnt/SecStorage/6b9bdec9-fdc9-3fdd-a5f8-0481df177ae8/snapshots/2/25 to copy > from S3 to cache. > I'm guessing it's an issue with the mkdirs() function in the code, but I've > been unable to find it. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CLOUDSTACK-6938) Cannot create template from snapshot when using S3 storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-6938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14039078#comment-14039078 ] Logan B commented on CLOUDSTACK-6938: - I've posted a patch for this issue to the review board & mailing list. Seems to be working for me, but I have no idea if the logic is actually sound. > Cannot create template from snapshot when using S3 storage > -- > > Key: CLOUDSTACK-6938 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6938 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Snapshot >Affects Versions: 4.4.0 > Environment: KVM + S3 Secondary Storage >Reporter: Logan B >Priority: Critical > Fix For: 4.4.0 > > > When trying to create a template from a snapshot with S3 secondary storage, > the command immediately fails with a NullPointerException. > This appears to only happen when there is a pre-existing snapshot folder in > the NFS staging store. This indicates that there is something wrong with the > copy command (e.g., it's using 'mkdir' instead of 'mkdir -p'). > The issue can be worked around by deleting the existing snapshot folder on > the staging store every time you want to create a new template. This is > obviously not viable for end users. > This issue should be fixed before 4.4 ships because it should be a stupid > simple thing to correct, but completely breaks restoring snapshots for end > users. Waiting for 4.5 would be far too long for an issue like this. > 2014-06-18 21:13:54,789 DEBUG [cloud.agent.Agent] > (agentRequest-Handler-2:null) Processing command: > org.apache.cloudstack.storage.command.CopyCommand > 2014-06-18 21:13:54,789 INFO [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Determined host 172.16.48.99 corresponds to IP > 172.16.48.99 > 2014-06-18 21:13:54,797 ERROR [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Unable to create directory > /mnt/SecStorage/6b9bdec9-fdc9-3fdd-a5f8-0481df177ae8/snapshots/2/25 to copy > from S3 to cache. > I'm guessing it's an issue with the mkdirs() function in the code, but I've > been unable to find it. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CLOUDSTACK-6938) Cannot create template from snapshot when using S3 storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-6938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14038846#comment-14038846 ] Logan B commented on CLOUDSTACK-6938: - Understandable, though a bug that makes existing features unusable seems like it should be fixed sooner rather than later. Since I would doubt 4.5 will release before September I think something this simple should be looked at. I'm attempting to come up with a patch, test it, and submit it for review, but having never done any real development before I don't know if I can get it in and approved before an RC build. > Cannot create template from snapshot when using S3 storage > -- > > Key: CLOUDSTACK-6938 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6938 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Snapshot >Affects Versions: 4.4.0 > Environment: KVM + S3 Secondary Storage >Reporter: Logan B >Priority: Critical > Fix For: 4.4.0 > > > When trying to create a template from a snapshot with S3 secondary storage, > the command immediately fails with a NullPointerException. > This appears to only happen when there is a pre-existing snapshot folder in > the NFS staging store. This indicates that there is something wrong with the > copy command (e.g., it's using 'mkdir' instead of 'mkdir -p'). > The issue can be worked around by deleting the existing snapshot folder on > the staging store every time you want to create a new template. This is > obviously not viable for end users. > This issue should be fixed before 4.4 ships because it should be a stupid > simple thing to correct, but completely breaks restoring snapshots for end > users. Waiting for 4.5 would be far too long for an issue like this. > 2014-06-18 21:13:54,789 DEBUG [cloud.agent.Agent] > (agentRequest-Handler-2:null) Processing command: > org.apache.cloudstack.storage.command.CopyCommand > 2014-06-18 21:13:54,789 INFO [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Determined host 172.16.48.99 corresponds to IP > 172.16.48.99 > 2014-06-18 21:13:54,797 ERROR [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Unable to create directory > /mnt/SecStorage/6b9bdec9-fdc9-3fdd-a5f8-0481df177ae8/snapshots/2/25 to copy > from S3 to cache. > I'm guessing it's an issue with the mkdirs() function in the code, but I've > been unable to find it. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CLOUDSTACK-6938) Cannot create template from snapshot when using S3 storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-6938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14038708#comment-14038708 ] Daan Hoogland commented on CLOUDSTACK-6938: --- Logan, I marked this as critical. blockers should be first discussed on list to find agreement and enough developers to work on them. > Cannot create template from snapshot when using S3 storage > -- > > Key: CLOUDSTACK-6938 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6938 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Snapshot >Affects Versions: 4.4.0 > Environment: KVM + S3 Secondary Storage >Reporter: Logan B >Priority: Critical > Fix For: 4.4.0 > > > When trying to create a template from a snapshot with S3 secondary storage, > the command immediately fails with a NullPointerException. > This appears to only happen when there is a pre-existing snapshot folder in > the NFS staging store. This indicates that there is something wrong with the > copy command (e.g., it's using 'mkdir' instead of 'mkdir -p'). > The issue can be worked around by deleting the existing snapshot folder on > the staging store every time you want to create a new template. This is > obviously not viable for end users. > This issue should be fixed before 4.4 ships because it should be a stupid > simple thing to correct, but completely breaks restoring snapshots for end > users. Waiting for 4.5 would be far too long for an issue like this. > 2014-06-18 21:13:54,789 DEBUG [cloud.agent.Agent] > (agentRequest-Handler-2:null) Processing command: > org.apache.cloudstack.storage.command.CopyCommand > 2014-06-18 21:13:54,789 INFO [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Determined host 172.16.48.99 corresponds to IP > 172.16.48.99 > 2014-06-18 21:13:54,797 ERROR [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Unable to create directory > /mnt/SecStorage/6b9bdec9-fdc9-3fdd-a5f8-0481df177ae8/snapshots/2/25 to copy > from S3 to cache. > I'm guessing it's an issue with the mkdirs() function in the code, but I've > been unable to find it. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CLOUDSTACK-6938) Cannot create template from snapshot when using S3 storage
[ https://issues.apache.org/jira/browse/CLOUDSTACK-6938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14036468#comment-14036468 ] Logan B commented on CLOUDSTACK-6938: - This is the relevant bit of code: In NfsSecondaryStorageResource.java: if (!downloadDirectory.mkdirs()) { final String errMsg = "Unable to create directory " + downloadPath + " to copy from S3 to cache."; s_logger.error(errMsg); return new CopyCmdAnswer(errMsg); } else { s_logger.debug("Directory " + downloadPath + " already exists"); } I believe mkdirs() returns false if the directory already exists. So this failure logic is prone to breaking. Better logic might be: if (downloadDirectory.exists()) { s_logger.debug("Directory " + downloadPath + " already exists"); } else { if (!downloadDirectory.mkdirs()) { final String errMsg = "Unable to create directory " + downloadPath + " to copy from S3 to cache."; s_logger.error(errMsg); return new CopyCmdAnswer(errMsg); } I'm not a programmer, but it seems that checking for the existing path before blindly failing would be better here. If this code checks out I'll try to figure out how to offer a commit for cherry picking. > Cannot create template from snapshot when using S3 storage > -- > > Key: CLOUDSTACK-6938 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6938 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Snapshot >Affects Versions: 4.4.0 > Environment: KVM + S3 Secondary Storage >Reporter: Logan B >Priority: Blocker > Fix For: 4.4.0 > > > When trying to create a template from a snapshot with S3 secondary storage, > the command immediately fails with a NullPointerException. > This appears to only happen when there is a pre-existing snapshot folder in > the NFS staging store. This indicates that there is something wrong with the > copy command (e.g., it's using 'mkdir' instead of 'mkdir -p'). > The issue can be worked around by deleting the existing snapshot folder on > the staging store every time you want to create a new template. This is > obviously not viable for end users. > This issue should be fixed before 4.4 ships because it should be a stupid > simple thing to correct, but completely breaks restoring snapshots for end > users. Waiting for 4.5 would be far too long for an issue like this. > 2014-06-18 21:13:54,789 DEBUG [cloud.agent.Agent] > (agentRequest-Handler-2:null) Processing command: > org.apache.cloudstack.storage.command.CopyCommand > 2014-06-18 21:13:54,789 INFO [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Determined host 172.16.48.99 corresponds to IP > 172.16.48.99 > 2014-06-18 21:13:54,797 ERROR [storage.resource.NfsSecondaryStorageResource] > (agentRequest-Handler-2:null) Unable to create directory > /mnt/SecStorage/6b9bdec9-fdc9-3fdd-a5f8-0481df177ae8/snapshots/2/25 to copy > from S3 to cache. > I'm guessing it's an issue with the mkdirs() function in the code, but I've > been unable to find it. -- This message was sent by Atlassian JIRA (v6.2#6252)