[jbosstools-issues] [JBoss JIRA] (JBIDE-13631) URL for embedded cartridges is empty

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Fri Feb 22 15:54:56 EST 2013


    [ https://issues.jboss.org/browse/JBIDE-13631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756217#comment-12756217 ] 

Andre Dietisheim edited comment on JBIDE-13631 at 2/22/13 3:53 PM:
-------------------------------------------------------------------

The url is extracted out of the creation log at object instance creation. If the cartridge has just been created, then the creation log is used. If we're looking for the url of an existing cartridge then the openshift-java-client is extracting it from the creation log. The lib is deciding upon info being *null* or not:
{code:title=com.openshift.internal.client.EmbeddedCartridgeResource}
	private String extractUrl(String info, List<Message> messages) {
		if (info != null) {
			return extractUrl(info);
		} else {
			return extractUrl(messages);
		}
	}
{code}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*Unfortunately even info is not "null" but "{}".* 
Therefore the code is using info instead of messages
I highly suspect some format change in the platform.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 

If the lib had taken messages, the url could have been extracted, since the messages contain the URL:

{code}
[
        {
            "exit_code" => undefined,
            "field" => undefined,
            "severity" => "info",
            "text" => "Added mysql-5.1 to application 1361484901005"
        },
        {
            "exit_code" => big integer 0,
            "field" => "result",
            "severity" => "info",
            "text" => "
MySQL 5.1 database added.  Please make note of these credentials:

   Root User: adminV15AnWB
   Root Password: 9DTqCwtcnc7f
   Database Name: 1361484901005

Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/

You can manage your new MySQL database by also embedding phpmyadmin-3.4.
The phpmyadmin username and password will be the same as the MySQL credentials above.
"
        },
        {
            "exit_code" => big integer 0,
            "field" => "appinfo",
            "severity" => "info",
            "text" => "Connection URL: mysql://127.1.249.1:3306/
"
        }
    ],
    "status" => "created",
    "supported_api_versions" => [
        big decimal 1.0,
        big decimal 1.1,
        big decimal 1.2,
        big decimal 1.3
    ]
{code}

But even the our regex would have failed to extract the correct url. It extracted 

{code}
mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
{code}

where it should have had extracted
{code}
mysql://127.1.249.1:3306/
{code}

So here again, we have a change in the platform formats that causes our library to fail.
                
      was (Author: adietish):
    The url is extracted out of the creation log at object instance creation. If the cartridge has just been created, then the creation log is used. If we're looking for the url of an existing cartridge then the openshift-java-client is extracting it from the creation log. The lib is deciding upon info being *null* or not:
{code:title=com.openshift.internal.client.EmbeddedCartridgeResource}
	private String extractUrl(String info, List<Message> messages) {
		if (info != null) {
			return extractUrl(info);
		} else {
			return extractUrl(messages);
		}
	}
{code}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*Unfortunately even info is not "null" but "{}".* 
Therefore the code is using info instead of messages
I highly suspect some format change in the platform.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 

If the lib had taken messages, the url could have been extracted, since the messages contain the URL:

{code}
[
        {
            "exit_code" => undefined,
            "field" => undefined,
            "severity" => "info",
            "text" => "Added mysql-5.1 to application 1361484901005"
        },
        {
            "exit_code" => big integer 0,
            "field" => "result",
            "severity" => "info",
            "text" => "
MySQL 5.1 database added.  Please make note of these credentials:

   Root User: adminV15AnWB
   Root Password: 9DTqCwtcnc7f
   Database Name: 1361484901005

Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/

You can manage your new MySQL database by also embedding phpmyadmin-3.4.
The phpmyadmin username and password will be the same as the MySQL credentials above.
"
        },
        {
            "exit_code" => big integer 0,
            "field" => "appinfo",
            "severity" => "info",
            "text" => "Connection URL: mysql://127.1.249.1:3306/
"
        }
    ],
    "status" => "created",
    "supported_api_versions" => [
        big decimal 1.0,
        big decimal 1.1,
        big decimal 1.2,
        big decimal 1.3
    ]
{code}

But even the our regex would have failed to extract the correct url. It extracted 

{code}
mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
{code}

where it should have had extracted
{code}
mysql://127.1.249.1:3306/
{code}
                  
> URL for embedded cartridges is empty
> ------------------------------------
>
>                 Key: JBIDE-13631
>                 URL: https://issues.jboss.org/browse/JBIDE-13631
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 4.0.0.Final
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>             Fix For: 4.1.0.Alpha2
>
>         Attachments: no-url.png
>
>
> Embedded cartridges for OpenShift application have an URL property. Currently JBDS/JBT doesn't show any, all URLs are blank

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list