You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Hemalatha Pal <he...@cimware.in> on 2021/05/28 08:25:40 UTC

Cloudstack source code compilation - RPMs build failed - LDAP

Hi,

I am new to this cloudstack. So I would need some pointers on how to proceed with resolving the below error.

I understand from the error that the build is looking for these jars in https://repo.maven.apache.org/maven2  link and it couldn't find the cloudstack directory under org.apache directory. 

Questions :
1) Why is cloudstack folder not found in the https://repo.maven.apache.org/maven2  - org.apache path provided in the source build files ?
2) If not found in this link https://repo.maven.apache.org/maven2 , then which url should I give for accessing these files ?
3) If I need to modify with the new url which has those jar files, then which pom.xml file should I modify ? Since I don't see a common pom.xml file which has both these jars (eg. cloud-server.jar) and url (https://repo.maven.apache.org/maven2 ) referred in the same file ?

Thanks in advance for your guidance.

Regards,
Hema

[root@centos8 ldap]# pwd 
/home/hema/apache-cloudstack-4.15.0.0-src/plugins/user-authenticators/ldap 
[root@centos8 ldap]# 

[root@centos8 ldap]# ls -lrt 
total 12 
drwxrwxr-x. 4 hema hema   30 Jan  5 10:51 src 
-rw-rw-r--. 1 hema hema 9515 Jan  5 10:51 pom.xml  

[root@centos8 ldap]# mvn -X install 
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) 
Maven home: /home/hema/cloudstack/apache-maven-3.8.1 
Java version: 11.0.11, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-0.el8_3.x86_64 
Default locale: en_IN, platform encoding: UTF-8 
OS name: "linux", version: "4.18.0-240.22.1.el8_3.x86_64", arch: "amd64", family: "unix" 
[DEBUG] Created new class realm maven.api 

[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for maven2-repository.dev.java.net (http://download.java.net/maven/2/). 
[WARNING] The POM for org.apache.cloudstack:cloud-server:jar:4.15.0.0 is missing, no dependency information available 
[WARNING] The POM for org.apache.cloudstack:cloud-api:jar:4.15.0.0 is missing, no dependency information available 
[WARNING] The POM for org.apache.cloudstack:cloud-utils:jar:4.15.0.0 is missing, no dependency information available 
[WARNING] The POM for org.apache.cloudstack:cloud-framework-config:jar:4.15.0.0 is missing, no dependency information available 
[WARNING] The POM for org.apache.cloudstack:cloud-api:jar:tests:4.15.0.0 is missing, no dependency information available 


[ERROR] Failed to execute goal on project cloud-plugin-user-authenticator-ldap: Could not resolve dependencies for project org.apache.cloudstack:cloud-plugin-user-authenticator-ldap:jar:4.15.0.0: The following artifacts could not be resolved: org.apache.cloudstack:cloud-server:jar:4.15.0.0, org.apache.cloudstack:cloud-api:jar:4.15.0.0, org.apache.cloudstack:cloud-utils:jar:4.15.0.0, org.apache.cloudstack:cloud-framework-config:jar:4.15.0.0, org.apache.cloudstack:cloud-api:jar:tests:4.15.0.0: org.apache.cloudstack:cloud-server:jar:4.15.0.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced ->

Re: Cloudstack source code compilation - RPMs build failed - LDAP

Posted by Hema <he...@cimware.in>.
Hi David,

Thank you for your response and pointers. For now with your suggestion, as a work around, I was able to skip the test and proceed with just source build by adding -DskipTests in mvn command in cloud.spec file. It helped. 

There are some java version mismatch errors in the source build in package 121/124 which I am debugging though pre-requisite was given as Java 11 but expecting Java 8. 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/cloud/api/doc/ApiXmlDocWriter has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Will keep you posted once the RPMs are successfully built. I will revisit the test scripts error after completing the source build.

Regards,
Hema

Re: Cloudstack source code compilation - RPMs build failed - LDAP

Posted by David Jumani <Da...@shapeblue.com>.
Hi Hema,

If it helps you can try and build it from source skipping the tests.
You can modify the cloud.spec to add the skip tests flag
________________________________
From: Hema <he...@cimware.in>
Sent: Saturday, June 5, 2021 4:42 PM
To: users@cloudstack.apache.org <us...@cloudstack.apache.org>
Subject: Re: Cloudstack source code compilation - RPMs build failed - LDAP

Hi,

I installed and configured LDAP as per the steps provided in the below link.
https://computingforgeeks.com/install-configure-openldap-server-centos/

[root@centos8 openldap]# netstat -ltnp | grep slapd
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:636             0.0.0.0:*               LISTEN      516121/slapd
tcp        0      0 0.0.0.0:389             0.0.0.0:*               LISTEN      516121/slapd
tcp6       0      0 :::389                  :::*                    LISTEN      516121/slapd
tcp6       0      0 :::3306                 :::*                    LISTEN      1869/mysqld

The slapd service seem to be running on 389 port whereas the code was referring to 11389 port. So I tried modifying the hard coded value from 11389 to 389 in the below file,

$HOME/apache-cloudstack-4.15.0.0-src/plugins/user-authenticators/ldap/src/test/java/org/apache/cloudstack/ldap/LdapUnitConnectionTest.java
static final int PORT =11389
to
static final int PORT = 389

Now I am getting the error as,
<<< ERROR!
com.unboundid.ldap.sdk.LDAPException: An error occurred while attempting to start listener 'default':  BindException(Address already in use (Bind failed)),

What is expected to be done then to resolve the error initially posted ?

Is LDAP connection a pre-requisite for the source to be built ?

Thanks,
Hema







 


Re: Cloudstack source code compilation - RPMs build failed - LDAP

Posted by Hema <he...@cimware.in>.
Hi,

I installed and configured LDAP as per the steps provided in the below link.
https://computingforgeeks.com/install-configure-openldap-server-centos/

[root@centos8 openldap]# netstat -ltnp | grep slapd
Active Internet connections (only servers) 
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     
tcp        0      0 0.0.0.0:636             0.0.0.0:*               LISTEN      516121/slapd         
tcp        0      0 0.0.0.0:389             0.0.0.0:*               LISTEN      516121/slapd         
tcp6       0      0 :::389                  :::*                    LISTEN      516121/slapd         
tcp6       0      0 :::3306                 :::*                    LISTEN      1869/mysqld          

The slapd service seem to be running on 389 port whereas the code was referring to 11389 port. So I tried modifying the hard coded value from 11389 to 389 in the below file,

$HOME/apache-cloudstack-4.15.0.0-src/plugins/user-authenticators/ldap/src/test/java/org/apache/cloudstack/ldap/LdapUnitConnectionTest.java 
static final int PORT =11389 
to 
static final int PORT = 389

Now I am getting the error as,
<<< ERROR! 
com.unboundid.ldap.sdk.LDAPException: An error occurred while attempting to start listener 'default':  BindException(Address already in use (Bind failed)),

What is expected to be done then to resolve the error initially posted ? 

Is LDAP connection a pre-requisite for the source to be built ?

Thanks,
Hema







Re: Cloudstack source code compilation - RPMs build failed - LDAP

Posted by Hema <he...@cimware.in>.
Hi,

For the below error observed, here is some analysis done. And my queries are listed below the analysis.

$HOME/apache-cloudstack-4.15.0.0-src/plugins/user-authenticators/ldap/src/test/java/org/apache/cloudstack/ldap/LdapUnitConnectionTest.java 
static final int PORT =11389;
public class LdapUnitConnectionTest { 
@Before 
    public void setUp() { 
        directoryTester = new DirectoryTester("localhost", PORT, BIND_DN, SECRET); 
    } 
    @Test 
    public void testLdapInteface() throws Exception { 
        directoryTester.assertDNExists("dc=am,dc=echt,dc=net"); 
    } 

$HOME/apache-cloudstack-4.15.0.0-src/plugins/user-authenticators/ldap/target/surefire-reports/TEST-org.apache.cloudstack.ldap.LdapUnitConnectionTest.xml
 <testcase name="testLdapInteface" classname="org.apache.cloudstack.ldap.LdapUnitConnectionTest" time="10.097"> 
    <error message="An error occurred while attempting to connect to server 35.186.238.101:11389:  IOException(LDAPException(resultCode=91 (connect error), errorMessage=&apos;Unable to establish a connection to server /35.186.238.101:11389 within the configured timeout of 10000 milliseconds

Here I see in the file LdapUnitConnectionTest.java from where it is throwing the error, it is connecting to "localhost" and port 11389 and not to 35.186.238.101 ip address as shown in the logs which actually is hardcoded in TEST-org.apache.cloudstack.ldap.LdapUnitConnectionTest.xml file. Hence it was misleading.

Questions :
1) If it is connecting to localhost and port 11389, then there are no ldap services running on that port on my localhost. Should any setup be done ? If so, can you please share the steps to setup LDAP on that port ?
2) While doing source build why testing scripts like connection is included as part of source build instead of just compilation and RPM build alone ? 
3) If we need to skip any of the test cases like these for which setup is not done, in which file should we comment ?
4) I am not seeing anyone who seemed to have faced this issue. Didn't find any google search results for my errors. Am I doing something wrong or missing any steps ?

Thanks in advance,
Hema




Re: Cloudstack source code compilation - RPMs build failed - LDAP

Posted by Hema <he...@cimware.in>.
Hi,

One of the changes that I was trying to make as mentioned below blindly, has generated the dependent jar files. Same lines were added for cloud-api, cloud-utils and cloud-framework-config for which it was throwing dependency errors. Not sure which file's changes helped in generating.. since when I moved the generated files and tried to generate it again with modified files one by one, it didnt generate the jar files.
 
$HOME/apache-cloudstack-4.15.0.0-src/plugins/user-authenticators/ldap/pom.xml
        <dependency>
            <groupId>org.apache.cloudstack</groupId>
            <artifactId>cloud-server</artifactId>
            <version>${project.version}</version>
        </dependency>

$HOME/apache-cloudstack-4.15.0.0-src/deps/install-non-oss.sh
mvn install:install-file -Dfile=cloud-server.jar -DgroupId=org.apache.cloudstack -DartifactId=cloud-server -Dversion=4.15.0.0 -Dpackaging=jar

/root/.m2/repository/org/apache/cloudstack/cloud-server/4.15.0.0
[root@centos8 4.15.0.0]# ls -lrt *.jar
total 3140
-rw-r--r--. 1 root root 3188078 May 29 06:56 cloud-server-4.15.0.0.jar
/root/.m2/repository/org/apache/cloudstack/cloud-api
/root/.m2/repository/org/apache/cloudstack/cloud-util
/root/.m2/repository/org/apache/cloudstack/cloud-framework-config

Now, the below error has come up and currently debugging it. Any pointers for the same will be helpful.

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.688 s <<< FAILURE! - in org.apache.cloudstack.ldap.LdapUnitConnectionTest 
testLdapInteface(org.apache.cloudstack.ldap.LdapUnitConnectionTest)  Time elapsed: 10.688 s  <<< ERROR!
com.unboundid.ldap.sdk.LDAPException: An error occurred while attempting to connect to server 35.186.238.101:11389:  IOException(LDAPException(resultCode=91 (connect error), errorMessage='Unable to establish a connection to server /35.186.238.101:11389 within the configured timeout of 10000 milliseconds.', ldapSDKVersion=4.0.14, revision=c0fb784eebf9d36a67c736d0428fb3577f2e25bb))
Caused by: java.io.IOException: LDAPException(resultCode=91 (connect error), errorMessage='Unable to establish a connection to server /35.186.238.101:11389 within the configured timeout of 10000 milliseconds.', ldapSDKVersion=4.0.14, revision=c0fb784eebf9d36a67c736d0428fb3577f2e25bb)
Caused by: com.unboundid.ldap.sdk.LDAPException: Unable to establish a connection to server /35.186.238.101:11389 within the configured timeout of 10000 milliseconds.

Thanks in advance,
Hema

Re: Cloudstack source code compilation - RPMs build failed - LDAP

Posted by Hemalatha Pal <he...@cimware.in>.
Hi Suresh,

Thanks for your response and the links. But I didnt find answers for my specific questions from that link. I am following the below Cloudstack documentation to build the source and generate RPMS.
https://docs.cloudstack.apache.org/en/latest/installguide/index.html#building-from-source

In the link that you have provided, it has dependent jars required for vmware but I didnt find the jars that I need for LDAP where the build is failing. Same with deps/install-non-oss.sh too, where dependent jars required for vmware is only present. I am not sure where to find equivalent jars required for LDAP to resolve the error which I have mentioned in my post and thats why raised it.

Regards,
Hema 

On 2021/05/28 09:30:01, Suresh Anaparti <Su...@shapeblue.com> wrote: 
> Hi Hemalatha Pal,
> 
> You can refer to the following wiki pages, to setup dev environment and build process. The CloudStack build, using mavin (mvn), would download the required dependencies from the maven repo. Only need to download external dependency jars manually, copy to 'deps' folder and 'mvn install' (check 'deps/install-non-oss.sh').
> 
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment
> 
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+CloudStack#HowtobuildCloudStack-InstallingMaven
> 
> Regards,
> Suresh
> 
> 
>  
> 


Re: Cloudstack source code compilation - RPMs build failed - LDAP

Posted by Suresh Anaparti <Su...@shapeblue.com>.
Hi Hemalatha Pal,

You can refer to the following wiki pages, to setup dev environment and build process. The CloudStack build, using mavin (mvn), would download the required dependencies from the maven repo. Only need to download external dependency jars manually, copy to 'deps' folder and 'mvn install' (check 'deps/install-non-oss.sh').

https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment

https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+CloudStack#HowtobuildCloudStack-InstallingMaven

Regards,
Suresh


 

On 28/05/21, 2:46 PM, "Hemalatha Pal" <he...@cimware.in> wrote:

    Hi,

    I am new to this cloudstack. So I would need some pointers on how to proceed with resolving the below error.

    I understand from the error that the build is looking for these jars in https://repo.maven.apache.org/maven2  link and it couldn't find the cloudstack directory under org.apache directory. 

    Questions :
    1) Why is cloudstack folder not found in the https://repo.maven.apache.org/maven2  - org.apache path provided in the source build files ?
    2) If not found in this link https://repo.maven.apache.org/maven2 , then which url should I give for accessing these files ?
    3) If I need to modify with the new url which has those jar files, then which pom.xml file should I modify ? Since I don't see a common pom.xml file which has both these jars (eg. cloud-server.jar) and url (https://repo.maven.apache.org/maven2 ) referred in the same file ?

    Thanks in advance for your guidance.

    Regards,
    Hema

    [root@centos8 ldap]# pwd 
    /home/hema/apache-cloudstack-4.15.0.0-src/plugins/user-authenticators/ldap 
    [root@centos8 ldap]# 

    [root@centos8 ldap]# ls -lrt 
    total 12 
    drwxrwxr-x. 4 hema hema   30 Jan  5 10:51 src 
    -rw-rw-r--. 1 hema hema 9515 Jan  5 10:51 pom.xml  

    [root@centos8 ldap]# mvn -X install 
    Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) 
    Maven home: /home/hema/cloudstack/apache-maven-3.8.1 
    Java version: 11.0.11, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-0.el8_3.x86_64 
    Default locale: en_IN, platform encoding: UTF-8 
    OS name: "linux", version: "4.18.0-240.22.1.el8_3.x86_64", arch: "amd64", family: "unix" 
    [DEBUG] Created new class realm maven.api 

    [DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for maven2-repository.dev.java.net (http://download.java.net/maven/2/). 
    [WARNING] The POM for org.apache.cloudstack:cloud-server:jar:4.15.0.0 is missing, no dependency information available 
    [WARNING] The POM for org.apache.cloudstack:cloud-api:jar:4.15.0.0 is missing, no dependency information available 
    [WARNING] The POM for org.apache.cloudstack:cloud-utils:jar:4.15.0.0 is missing, no dependency information available 
    [WARNING] The POM for org.apache.cloudstack:cloud-framework-config:jar:4.15.0.0 is missing, no dependency information available 
    [WARNING] The POM for org.apache.cloudstack:cloud-api:jar:tests:4.15.0.0 is missing, no dependency information available 


    [ERROR] Failed to execute goal on project cloud-plugin-user-authenticator-ldap: Could not resolve dependencies for project org.apache.cloudstack:cloud-plugin-user-authenticator-ldap:jar:4.15.0.0: The following artifacts could not be resolved: org.apache.cloudstack:cloud-server:jar:4.15.0.0, org.apache.cloudstack:cloud-api:jar:4.15.0.0, org.apache.cloudstack:cloud-utils:jar:4.15.0.0, org.apache.cloudstack:cloud-framework-config:jar:4.15.0.0, org.apache.cloudstack:cloud-api:jar:tests:4.15.0.0: org.apache.cloudstack:cloud-server:jar:4.15.0.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced ->