Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sync of template.properties in Swift #1331

Merged
merged 1 commit into from
May 18, 2016
Merged

Conversation

syed
Copy link
Contributor

@syed syed commented Jan 12, 2016

When using Swift as a secondary storage, we create a template.properties file which stores the metadata about the template. Currently the data which is present in the file is incorrect which leads to templates becoming unavailable after they are downloaded. This fix makes sure that the template.properties has the correct "path" set so that templates are available.

I've also done a bit of cleanup and made the code bit more clean.

@DaanHoogland
Copy link
Contributor

@syed thanks for picking this up. Can you

  • link this to a ticket
  • describe any testing you did (I can't test this)

protected boolean swiftUploadMetadataFile(SwiftTO swift, File srcFile, String containerName) throws IOException {


//create a template.properties for Swift with its correct unique name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you went through the trouble of cleaning up some of the code, how about you improve it some more by turning this comment into a javadoc comment for this method, also describing the parameters involved.

If you like this idea, I'd suggest going ahead and writing another javadoc comment for the copyFromNfsToSwift method.

Little things like these can go a long way to improve code readability. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I finally was able to get some time to work on this again. I'll send a new PR soon with your comments.

@DaanHoogland
Copy link
Contributor

@cristofolini are you aware that you can write a PR for a PR? you can find the example of checking out a pr in tools/git and after that you can just PR to the branch from which the original PR was created.

@cristofolini
Copy link
Contributor

@DaanHoogland That's a really interesting feature which I wasn't aware of. I'm afraid I'll be out of commission for most of today but I'd love to try it out as soon as I can get my hands on a computer.

@cristofolini
Copy link
Contributor

@DaanHoogland @syed I've opened a pull request containing some simple javadocs to @syed's swift-restart-fix branch.

} else if (destData.getObjectType() == DataObjectType.VOLUME) {
VolumeObjectTO newVol = new VolumeObjectTO();
newVol.setPath(containerName);
newVol.setSize(srcFile.length());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% related to this PR, but are the sizes on volumes and snapshots correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @pdube. That should be the virtual size (not the physical)

@pdube
Copy link
Contributor

pdube commented Jan 19, 2016

Code LGTM, as a general comment though, I think it is cleaner to be as precise as possible with exception handling.

@syed
Copy link
Contributor Author

syed commented Jan 21, 2016

Jira ticket : CLOUDSTACK-9247

I've tested this on our local setup with swift as a secondary storage.

I create a template from a snapshot and restart the management server. I don't see the problem where the template went back to not ready.

@wido
Copy link
Contributor

wido commented Jan 27, 2016

Code looks good, but I have no way of testing this since I don't have Swift...

@pdube
Copy link
Contributor

pdube commented Feb 3, 2016

Tested on local setup, the template.properties is now uploaded correctly LGTM

@pdion891
Copy link
Contributor

pdion891 commented Feb 4, 2016

tested, I think this should be ported into master as well.

@swill
Copy link
Contributor

swill commented Feb 4, 2016

Should Jenkins and CI checks be succeeding or is it because the tests do not have access to a Swift instance to test and succeed?

The code looks good to me. I have not tested because I do not have access to a different Swift installation than the others who have tested already.

@DaanHoogland
Copy link
Contributor

@swill @syed please have a look at : services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java:941: Line has trailing spaces.

@syed
Copy link
Contributor Author

syed commented Feb 8, 2016

Fixed

@syed
Copy link
Contributor Author

syed commented Feb 9, 2016

@DaanHoogland I'm not sure why the tests are failing. My changes shouldn't have affected that

@kollyma
Copy link

kollyma commented Mar 23, 2016

@syed: Thanks a lot for your fix. We are facing the same issue with CS4.8 and NFS secondary storage. Templates go into "Not Ready" when restarting the management server. Did you had the chance to verify what causes the job to fail?

@bvbharatk
Copy link
Contributor

Link to logs Folder (search by build_no): https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0

ACS CI BVT Run

Sumarry:
Build Number 126
Hypervisor xenserver
NetworkType Advanced
Passed=104
Failed=2
Skipped=4

Failed tests:

  • integration.smoke.test_guest_vlan_range.TestDedicateGuestVlanRange
    • test_dedicateGuestVlanRange Failed
  • integration.smoke.test_volumes.TestCreateVolume
    • test_06_download_detached_volume Failed

Skipped tests:
test_vm_nic_adapter_vmxnet3
test_deploy_vgpu_enabled_vm
test_06_copy_template
test_06_copy_iso

Passed test suits:
integration.smoke.test_deploy_vm_with_userdata.TestDeployVmWithUserData
integration.smoke.test_affinity_groups_projects.TestDeployVmWithAffinityGroup
integration.smoke.test_portable_publicip.TestPortablePublicIPAcquire
integration.smoke.test_over_provisioning.TestUpdateOverProvision
integration.smoke.test_global_settings.TestUpdateConfigWithScope
integration.smoke.test_scale_vm.TestScaleVm
integration.smoke.test_service_offerings.TestCreateServiceOffering
integration.smoke.test_loadbalance.TestLoadBalance
integration.smoke.test_routers.TestRouterServices
integration.smoke.test_reset_vm_on_reboot.TestResetVmOnReboot
integration.smoke.test_snapshots.TestSnapshotRootDisk
integration.smoke.test_deploy_vms_with_varied_deploymentplanners.TestDeployVmWithVariedPlanners
integration.smoke.test_network.TestDeleteAccount
integration.smoke.test_non_contigiousvlan.TestUpdatePhysicalNetwork
integration.smoke.test_deploy_vm_iso.TestDeployVMFromISO
integration.smoke.test_public_ip_range.TestDedicatePublicIPRange
integration.smoke.test_multipleips_per_nic.TestDeployVM
integration.smoke.test_regions.TestRegions
integration.smoke.test_affinity_groups.TestDeployVmWithAffinityGroup
integration.smoke.test_network_acl.TestNetworkACL
integration.smoke.test_pvlan.TestPVLAN
integration.smoke.test_ssvm.TestSSVMs
integration.smoke.test_nic.TestNic
integration.smoke.test_deploy_vm_root_resize.TestDeployVM
integration.smoke.test_resource_detail.TestResourceDetail
integration.smoke.test_secondary_storage.TestSecStorageServices
integration.smoke.test_vm_life_cycle.TestDeployVM
integration.smoke.test_disk_offerings.TestCreateDiskOffering

@syed
Copy link
Contributor Author

syed commented Mar 25, 2016

@kollyma This was happening for swift because the template.properties file was not correctly populated. So, when a management restart happens, it syncs data from the secondary storage to see which files are present and which files need to be downloaded and it is at this point that the managment server sets the templates in the DB to not ready state. I'm not sure if this is the case with pure NFS but you might want to look at your template.properties files on the NFS to make sure they are correct.

@kollyma
Copy link

kollyma commented Mar 28, 2016

@syed: thanks for the feedback. Here a more detailed description, based on your comments.
Setup: CS4.8, nfs secondary storage, kvm with local storage

# cat template.properties 
uniquename=225-2-c7401a18-2163-3c22-9799-3cc9b79cb771
filename=eabd7703-4203-49c5-a3a3-f8234f2d1c23.qcow2
size=1753481216c22-9799-3cc9b79cb771
qcow2.filename=eabd7703-4203-49c5-a3a3-f8234f2d1c23.qcow2
qcow2.virtualsize=21474836480
public=true
id=1

Entry on the management server:

 select * from vm_template where name = "myname2" \G;
*************************** 1. row ***************************
                  id: 225
         unique_name: 225-2-c7401a18-2163-3c22-9799-3cc9b79cb771
                name: myname2
                uuid: cec0787b-5362-4e29-9ca6-63697ff8d872
              public: 1
            featured: 0
                type: USER
                 hvm: 1
                bits: 64
                 url: NULL
              format: QCOW2
             created: 2016-03-28 18:36:00
             removed: NULL
          account_id: 2
            checksum: NULL
        display_text: myname
     enable_password: 0
       enable_sshkey: 0
         guest_os_id: 221
            bootable: 1
         prepopulate: 0
         cross_zones: 0
         extractable: 0
     hypervisor_type: KVM
  source_template_id: 215
        template_tag: NULL
            sort_key: 0
                size: 21474836480
               state: Active
        update_count: 0
             updated: NULL
dynamically_scalable: 0

Logs after management server restart:

2016-03-28 21:06:33,660 INFO  [o.a.c.s.i.TemplateServiceImpl] (AgentConnectTaskPool-3:ctx-3eb6adca) (logid:9e020fbf) Template Sync did not find 225-2-c7401a18-2163-3c22-9799-3cc9b79cb771 on image store 1, may request download based on available hypervisor types
2016-03-28 21:06:33,661 INFO  [o.a.c.s.i.TemplateServiceImpl] (AgentConnectTaskPool-3:ctx-3eb6adca) (logid:9e020fbf) Removing leftover template 225-2-c7401a18-2163-3c22-9799-3cc9b79cb771 entry from template store table
2016-03-28 21:06:33,668 INFO  [o.a.c.s.i.TemplateServiceImpl] (AgentConnectTaskPool-3:ctx-3eb6adca) (logid:9e020fbf) Skip downloading template 225-2-c7401a18-2163-3c22-9799-3cc9b79cb771 since no url is specified.

You are referring to the path set incorrectly in template properties. The cloudstack logs says "Template Sync did not find..." Do we have the same issue ? the template file is present on the nfs:

template/tmpl/2/225# ls
eabd7703-4203-49c5-a3a3-f8234f2d1c23.qcow2 template.properties

@swill
Copy link
Contributor

swill commented Apr 8, 2016

@syed can you squash the commits please and do a push -f to update the PR branch?

Do you have any feedback for @kollyma if he is seeing a similar issue as what you fixed here for swift? it would be worth understanding if the problem exists in more than one place so we can better understand if we need another PR for NFS storage as well.

@syed
Copy link
Contributor Author

syed commented Apr 9, 2016

@swill I've squashed the commits

@kollyma I'm sorry I missed your message. Do you still see a problem? Something strage that I see in your output is the size=1753481216c22-9799-3cc9b79cb771 are you sure this is the case?

@rafaelweingartner
Copy link
Member

Hi, would you mind extracting to a method lines 606-612? They are duplicated at line 627.
Then, you could even create test cases for it.

@syed
Copy link
Contributor Author

syed commented Apr 10, 2016

@rafaelweingartner Done. Although I didn't create any test cases yet. There is nothing much to test. The function doesn't throw any execptions, doesn't expect any results so I think this should be good.

@swill I've rebased again so it is still a single commit

@rafaelweingartner
Copy link
Member

@syed, you could delete the line 631, or use it as a java doc that explains the method.

I believe that there is, at least, one test you can do here. You could test if an exception happens while calling the “execute” method with the “deleteCommand” variable. If an exception happens it cannot be re-thrown by this method, and it has to be logged as a debug message.

@syed
Copy link
Contributor Author

syed commented Apr 11, 2016

@rafaelweingartner Updated the comment as a javadoc.

For the test. I am not sure what the best strategy is. Maybe you can help me understand better. For me this method should be private and I don't know how the community feels like testing private methods.

@rafaelweingartner
Copy link
Member

@syed, you can change the method to be protected.
IMO every single method that has some logic in it should be tested without any discrimination among private and non-private ones.

To write a test for this method, you can use Mockito; you can use the spy method into the object that you want to test (NfsSecondaryStorageResource), then you can force an exception to be thrown when the "execute" method is called with “deleteCommand” object.
To check if the exception was treated properly you can use Mockito to mock the s_logger object and check if the “debug” method was called after the exception is thrown

This way, if someone changes the logic and let the exception be re-thrown, the test case will catch. Also, if someone silences the exception, the test case will catch.

If you have doubts/problems when writing the test case, just call me.

* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.storage.resource;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is nothing about that is specific to secondary storage, Why not place this class in a more general package such as com.cloud.test.utils?

@rafaelweingartner
Copy link
Member

rafaelweingartner commented Apr 25, 2016

@jburwell, @syed, sorry the long post, I did a research on a few things and I would like to share with you guys.

I was just looking at the state of this PR, and I noticed that the number of lines added jumped to 300+; most of those lines are needed in order to write a test case using the “TestAppender” approach.
Please do not take me in a bad way; I find discussions like this very healthy for the future of the project. I also know that the class “TestAppender” is there to be reused in some other tests that want to check the use of log; but still, it feels pretty complicated to me. Giving that, do you see why when I created the test as an example for @syed, I used the Mocking approach? It feels simpler and more natural to write tests using that approach, at least to me.

Additionally, I was curious when you mentioned that the use of “static final” delimiters could optimize the GC, given that it (the GC) would not check if those attributes have or not to be garbage collected. I had never heard that before, so I tried to find something online. If you have some reliable reference about that, could you share?

I tried to find some specs or guideline documents from either Oracle or OpenJDK without much success. However, I found something like you said to the android JVM [1], but that would not be our case. Then, I read some articles (not scientific ones) from IBM [2] and Oracle [3] about the tuning of java code. But still, they did not mention anything related to what you said. Then, I decided to revisit a forum that I did not visit for a long time, since the time of my first Java certification (I am definitely getting old :( ), the coderanch [4]. There I found something that may be related to what you said [5]. There was a discussion there about the GC and static variables; at some point, someone highlights that “Static variables are destroyed when the class is unloaded”. After that, I also found this [6] on Stack overflow, in which it is described that “Static variables cannot be elected for garbage collection while the class is loaded. They can be collected when the respective class loader (that was responsible for loading this class) is itself collected for garbage.”. I believe that was the point you wanted to make, right? Static variables are not GCed by the GC, they are not even checked.

If that was the case, it would have nothing to do with the “final” keyword per se, but rather with the use of the “static” keyword.

After having said that, perhaps we could benefit from both worlds? I mean we could still use the “Logger” variable as static, but not final; then, we would be able to write a test case using Mockito (as the first example I presented to @syed), which would add less code.
What do you think about that?

Additionally, I had taken a look at some spring framework code. Their framework is not only the base of ACS but also many other huge projects; so, I thought it would be interesting to see how they use the logger variables. They use their “logger” attributes as Object variables and not Classes. With that approach when you extend their code, you “get for free” a logger instance to be used. I believe that is why I am so used to loggers being object attributes. I might have been working too much with their components and frameworks.

When we do that, we can avoid the following example that happens in ACS:
Let’s take the example of “NfsSecondaryStorageResource” class. That class is an intermediate class to singletons (LocalNfsSecondaryStorageResource, MockLocalNfsSecondaryStorageResource, PremiumSecondaryStorageResource and SimulatorSecondaryStorageResource). All of them also have a Logger instance for their respective class. Also, the “NfsSecondaryStorageResource” extends the “ServerResourceBase” that has a Logger instance too. In total, we have 5 Logger instances. One for each class, giving that all of them are static attributes. If we used an approach similar to the one that is used by Spring-*, we would have one “Logger” instance for each singleton, which would represent 4 logger instances.

I did some tests, and the approximated size of a Logger instance is ~820 bytes. So, if we save the instantiation of a few of this we can reduce a little bit of the use of ACS memory, giving that due to the way we create “Logger” objects today, we have an instance even for classes that are not object per se, but intermediated classes in a hierarchy of singletons.

[1] http://developer.android.com/training/articles/perf-tips.html
[2] http://www.ibm.com/developerworks/library/j-jtp01274/
[3] https://docs.oracle.com/cd/E26576_01/doc.312/e24936/tuning-apps.htm#GSPTG00161
[4] http://www.coderanch.com
[5] http://www.coderanch.com/t/381848/java/java/Garbage-Collector-Static-Variables
[6] http://stackoverflow.com/questions/453023/are-static-fields-open-for-garbage-collection

@jburwell
Copy link
Contributor

@rafaelweingartner yes, as I have said, final statics are not evaluated for GC. A single case is not a noticeable problem. However, if made all loggers were made instance variables, given the number we have, it would become a problem. You stated that your preference was to make loggers instance variables, and that they being final static was purely cosmetic. My point is that there are both performance and capability motivations to make them final static (i.e. the ability to log from static methods and accumulated GC overhead).

Personally, I use Mockito (and its ilk) sparingly. Namely, I only use it in circumstances where language constructs are unable to mock a mechanism. First, I find it more difficult to understand the intentions of a test using Mockito rather than pure Java as it layers another set of abstractions onto the test. Second, Mockito approaches discourage reuse. We could use Mockito to mock logging tests in this case. However, we have done nothing to make testing of expected logging easier for future test cases.

It's most important to me that we do not start turning references to constant values into instance variables due to potential GC churn. It's less a memory size issue than it is about the length of GC operations and CPU overhead. The Mockito vs. TestAppender approach is up to @syed and what he feels most comfortable implementing.

@rafaelweingartner
Copy link
Member

I do not find them (final static) purely cosmetics (we are using too much this expression lately). I understand its use, as I presented the references about the GC and static variables. Maybe we could use only the static keyword? That is what I am saying. The final keyword would work more like an assurance, so no one can change that reference during runtime. But, I believe we do not need such guarantees, right?

I could not find anything (specs or guides from Oracle or OpenJDK) saying that the "final" keyword would provide such improvements. Maybe you could help me find something to clarify my doubts?

About logging from static methods, I do not find that argument appealing. Even though static methods may be appealing, they are easier to use and code, not needing to integrate into a framework life cycle to wire all of the dependencies. I believe that if we have an “util” class with static methods, then it (the util class) will have a static variable “Logger”; now, mixing static methods into a singleton; I see that as an anti-pattern. This is very personal, I like to delegate very specific tasks to each class. I believe that facilitates the design of the software and the writing of test cases (both unit and integration one)

I understand your feelings about Mockc. I had the same some time ago when I started working with TDD. At that time I used Easymock. But still, the point is that, once we start writing test cases (the unit ones), we get into a moment in which we have to write integration tests. That means a method that uses few methods that are self-contained and unit tested. Therefore, we do not need to test the whole method (we already assured that the units are working), but only check if the method is calling the methods (units) it should (checking the order), with the parameters that are expected and at the end returning what we expect it to return. To facilitate that job we would need to use Mocks, then we would not have to prepare complicated set ups to write our tests.

About the overhead problems to the GC, as I said, I am talking about singletons, they are created only once in the whole application life cycle. Therefore, they would not cause overhead problems with the GC.

@jburwell
Copy link
Contributor

@rafaelweingartner I apologize -- I did not understand that you were focused on final not final static. You are correct, final has nothing to do with garbage collection -- it is about thread safety. There are very few (and rare) circumstances where a static reference should be mutable because it accessible across thread boundarys. When they need to be mutable, special care must be taken to ensure exclusive access (e.g. synchronized blocks, ReentrantLock, AtomicReference, etc). Therefore, I always put the two together. In this case, the logger is a constant value and should be declared final. Sacrificing thread-safety for unit test is not an appropriate trade-off in my opinion.

Stepping back a bit, why are we investing so much time and effort to test a DEBUG log message? DEBUG level messages should only be for developers during development of the system. Not only is a low value item to test, it makes the test case brittle as there should never be any guarantees about log messages at ``DEBUGandTRACE` log levels. In my opinion, @syed should remove this part of the test entirely.

@rafaelweingartner
Copy link
Member

@jburwell, that is great that we understood each other ;)

Your questions is a great one, why are we discussion this, and why testing that. Actually, I do not care much about the writing of test cases to check if something is logged.

The point is that there is that “cleanupStagingNfs” method. If we want to write a nice test to it, we would have to test the happy day flow; that means if the method is creating the “DeleteCommand” object and then if it call the “execute” method with that object. That is one test case. I see that kind of test as an integration test; meaning, a test if a method is using some other method.

Having said that, I see another flow of execution; we might have an exception. So, if an exception occurs, what happens? By the code, today we log the exception and the execution continues.

Then we would have to ask ourselves, do we want to enforce that? If someone silences that exception, would we like to catch that?

If someone re-throws the exception, using a runtime one; would we like to detect that?

At first sight, I think that we should guarantee both executions flows. But, if it becomes a burden, we can let it go.

@syed
Copy link
Contributor Author

syed commented May 9, 2016

@rafaelweingartner @jburwell Sorry for the late reply to this. I was on vacation and returned today. I've decided to use John's approach for the logging test as I feel it is more natural. Also the dicussion about final static being immutable and skipped by GC makes me feel that using an appender makes more sense. Furthermore, the TestAppender class provided by @jburwell is generic so that other tests can use it too.

I will sqash the commits as it looking pretty good now unless you guys have any more comments.

@swill
Copy link
Contributor

swill commented May 10, 2016

@syed this is not compiling for me. Can you review?

org.apache.cloudstack.storage.resource.NfsSecondaryStorageResourceTest
Running org.apache.cloudstack.storage.resource.LocalNfsSecondaryStorageResourceTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< FAILURE! - in org.apache.cloudstack.storage.resource.LocalNfsSecondaryStorageResourceTest
testExecuteRequest(org.apache.cloudstack.storage.resource.LocalNfsSecondaryStorageResourceTest)  Time elapsed: 0.001 sec  <<< ERROR!
javax.naming.ConfigurationException: Unable to find agent.properties.
        at org.apache.cloudstack.storage.resource.LocalNfsSecondaryStorageResourceTest.loadProperties(LocalNfsSecondaryStorageResourceTest.java:129)
        at org.apache.cloudstack.storage.resource.LocalNfsSecondaryStorageResourceTest.setUp(LocalNfsSecondaryStorageResourceTest.java:68)


Results :

Tests in error: 
  LocalNfsSecondaryStorageResourceTest.setUp:68->loadProperties:129 Configuration

Tests run: 3, Failures: 0, Errors: 1, Skipped: 0

@syed
Copy link
Contributor Author

syed commented May 10, 2016

@swill the problem is because of LocalNfsSecondaryStorageResourceTest. Before my commit, tests were ignored for this module probably because of the above file. Since I added a new file and enabled tests, the file started bothering again. For now I've silenced it.

@swill
Copy link
Contributor

swill commented May 11, 2016

@syed can you have a look at this one.

I am not sure why, but I am having a lot of trouble with this PR. I have not been able to get a test run to actually works. I have tried to run CI on this 3 times and I always get the following:

INFO  [c.c.r.ResourceManagerImpl] (ApiServer-1:ctx-7bf8070e ctx-cdcb3f39) (logid:2044d020) Trying to add a new host at http://kvm1 in data center 1
INFO  [o.a.c.f.j.i.AsyncJobManagerImpl] (AsyncJobMgr-Heartbeat-1:ctx-412302f9) (logid:5b139200) Begin cleanup expired async-jobs
INFO  [o.a.c.f.j.i.AsyncJobManagerImpl] (AsyncJobMgr-Heartbeat-1:ctx-412302f9) (logid:5b139200) End cleanup expired async-jobs
INFO  [o.a.c.e.o.NetworkOrchestrator] (Network-Scavenger-1:ctx-a52a3147) (logid:86cda124) NetworkGarbageCollector uses '10' seconds for GC interval.
INFO  [c.c.h.k.d.LibvirtServerDiscoverer] (ApiServer-1:ctx-7bf8070e ctx-cdcb3f39) (logid:2044d020) cloudstack agent setup command failed: cloudstack-setup-agent  -m 192.168.22.61 -z 1 -p 1 -c 1 -g 57acd541-cd37-34ea-af6a-dc6ecd007325 -a --pubNic=cloudbr0 --prvNic=cloudbr1 --guestNic=cloudbr0 --hypervisor=kvm
WARN  [c.c.r.ResourceManagerImpl] (ApiServer-1:ctx-7bf8070e ctx-cdcb3f39) (logid:2044d020) Unable to find the server resources at http://kvm1
INFO  [c.c.u.e.CSExceptionErrorCode] (ApiServer-1:ctx-7bf8070e ctx-cdcb3f39) (logid:2044d020) Could not find exception: com.cloud.exception.DiscoveryException in error code list for exceptions
WARN  [o.a.c.a.c.a.h.AddHostCmd] (ApiServer-1:ctx-7bf8070e ctx-cdcb3f39) (logid:2044d020) Exception: 
com.cloud.exception.DiscoveryException: Unable to add the host
        at com.cloud.resource.ResourceManagerImpl.discoverHostsFull(ResourceManagerImpl.java:802)
        at com.cloud.resource.ResourceManagerImpl.discoverHosts(ResourceManagerImpl.java:597)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at com.sun.proxy.$Proxy159.discoverHosts(Unknown Source)
        at org.apache.cloudstack.api.command.admin.host.AddHostCmd.execute(AddHostCmd.java:142)
        at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:150)
        at com.cloud.api.ApiServer.queueCommand(ApiServer.java:698)
        at com.cloud.api.ApiServer.handleRequest(ApiServer.java:529)
        at com.cloud.api.ApiServer.handle(ApiServer.java:434)
        at org.apache.http.protocol.HttpService.doService(HttpService.java:423)
        at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:341)
        at com.cloud.api.ApiServer$WorkerTask.runInContext(ApiServer.java:1236)
        at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
        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 org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
INFO  [c.c.a.ApiServer] (ApiServer-1:ctx-7bf8070e ctx-cdcb3f39) (logid:2044d020) Unable to add the host

The fact that both Jenkins and Travis are failing may also be relevant.

@swill
Copy link
Contributor

swill commented May 13, 2016

CI RESULTS

Tests Run: 85
  Skipped: 0
   Failed: 0
   Errors: 0
 Duration: 4h 18m 48s

Associated Uploads

/tmp/MarvinLogs/DeployDataCenter__May_12_2016_21_43_23_1TT3ZU:

/tmp/MarvinLogs/test_network_R3P7FB:

/tmp/MarvinLogs/test_vpc_routers_HKWN9Z:

Uploads will be available until 2016-07-13 02:00:00 +0200 CEST

Comment created by upr comment.

@swill
Copy link
Contributor

swill commented May 13, 2016

@syed can you force push or close and reopen the PR to kick off travis and jenkins? I think this one seems to be in a pretty good state now...

@swill
Copy link
Contributor

swill commented May 13, 2016

@syed failed again. :(

@syed
Copy link
Contributor Author

syed commented May 13, 2016

@swill looks like jenkins failed because of some licence issue in one file. I've checked all the files that I have changed and every one seems to have the correct licence. I don't have access but is it possible to check /home/jenkins/jenkins-slave/workspace/cloudstack-pr-analysis/target/rat.txt which has more info.

@syed
Copy link
Contributor Author

syed commented May 13, 2016

@swill I got the file from jenkins and it points to utils/testsmallfileinactive ... I have no idea where this file came from

@syed
Copy link
Contributor Author

syed commented May 13, 2016

@DaanHoogland
Copy link
Contributor

@syed can you close and reopen to see if the error is persistent?

@syed
Copy link
Contributor Author

syed commented May 13, 2016

@DaanHoogland sure ... doesn't hurt

@syed syed closed this May 13, 2016
@syed syed reopened this May 13, 2016
@asfgit asfgit merged commit f5ac8dd into apache:4.7 May 18, 2016
asfgit pushed a commit that referenced this pull request May 18, 2016
Fix Sync of template.properties in SwiftWhen using Swift as a secondary storage, we create a template.properties file which stores the metadata about the template. Currently the data which is present in the file is incorrect which leads to templates becoming unavailable after they are downloaded. This fix makes sure that the template.properties has the correct "path" set so that templates are available.

I've also done a bit of cleanup and made the code bit more clean.

* pr/1331:
  Fix Sync of template.properties in Swift

Signed-off-by: Will Stevens <williamstevens@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.