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

Failed to retrieve remote metadata. Return code is: 503 , ReasonPhrase:Service Unavailable #38

Closed
toshovski opened this issue Feb 16, 2015 · 23 comments
Assignees
Labels
Milestone

Comments

@toshovski
Copy link

I created a new channel named p2 and added all possible aspects (First tried these from the tutorial, then added all of them). When I try to deploy an artifact I receive the following error:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project parent: Failed to retrieve remote metadata de.dentrassi:parent:1.0.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata de.dentrassi:parent:1.0.0-SNAPSHOT/maven-metadata.xml from/to p2 (http://localhost:8080/maven/p2): Failed to transfer file: http://localhost:8080/maven/p2/de/dentrassi/parent/1.0.0-SNAPSHOT/maven-metadata.xml. Return code is: 503 , ReasonPhrase:Service Unavailable. -> [Help 1]

Any idea ?

@ctron
Copy link
Owner

ctron commented Feb 16, 2015

503 is given when the StorageService, the one doing all the work, is not present. It normally is not present when the database is not configured.

You can check on the OSGi console using:

ls | grep de.dentrassi.pm.storage.service and looking for "de.dentrassi.pm.storage.service"

and then

"comp " ... where is the ID found from the "ls" command

e.g.:

osgi> ls | grep de.dentrassi.pm.storage.service
20  Active      de.dentrassi.pm.storage.service         de.dentrassi.pm.storage.service.jpa(bid=66)
21  Active      de.dentrassi.pm.storage.service.deployAuth          de.dentrassi.pm.storage.service.jpa(bid=66)
true
osgi> comp 20
    Component[
    name = de.dentrassi.pm.storage.service
    activate = start
    deactivate = stop
    modified = 
    configuration-policy = optional
    factory = null
    autoenable = true
    immediate = true
    implementation = de.dentrassi.pm.storage.service.jpa.StorageServiceImpl
    state = Unsatisfied
    properties = 
    serviceFactory = false
    serviceInterface = [de.dentrassi.pm.storage.service.StorageService]
    references = {
        Reference[name = EntityManagerFactory, interface = javax.persistence.EntityManagerFactory, policy = static, cardinality = 1..1, target = (osgi.unit.name=de.dentrassi.pm.storage.jpa), bind = setEntityManagerFactory, unbind = null]
    }
    located in bundle = de.dentrassi.pm.storage.service.jpa_1.0.0.qualifier [66]
]
Dynamic information :
  The component is satisfied
  All component references are satisfied
  Component configurations :
    Configuration properties:
      component.name = de.dentrassi.pm.storage.service
      EntityManagerFactory.target = (osgi.unit.name=de.dentrassi.pm.storage.jpa)
      component.id = 48
      objectClass = String[de.dentrassi.pm.storage.service.StorageService]
    Instances:
      org.eclipse.equinox.internal.ds.impl.ComponentInstanceImpl@335298ba
        Bound References:
        String[javax.persistence.EntityManagerFactory]
            -> org.eclipse.gemini.jpa.proxy.EMFServiceProxyHandler@4d2dfef4

osgi> 

If the service is up and if now, why.

ctron added a commit that referenced this issue Feb 16, 2015
@toshovski
Copy link
Author

I receive the same output like yours. Maybe also a docker problem?

@ctron ctron self-assigned this Feb 17, 2015
@ctron ctron added this to the v0.1.4 milestone Feb 17, 2015
@ctron
Copy link
Owner

ctron commented Feb 17, 2015

Not that I am aware of ... which version of Package Drone are you running? This should be in the lower right of each page.

@ctron
Copy link
Owner

ctron commented Feb 17, 2015

I am preparing a bug fix release right now, which also fixes a bug in the maven adapter. Although this would cause a 500, instead of a 503.

This should be done in about an hour. I will let you know when the new docker version is available.

@ctron
Copy link
Owner

ctron commented Feb 17, 2015

Ok, so after I did:

docker pull ctron/package-drone:latest

I had the new version (0.1.4) and the problems which I had with maven were gone.

@toshovski
Copy link
Author

I used Package Drone 0.1.2.20150212-1156.

The newer version Package Drone 0.1.4.20150217-1154 doesn't solve the problem. Please tell me where do I have to call maven deploy? I have the following projects and build with tycho:

  • parent
  • p2
  • product
  • feature
  • target

There are also some testProjects in your repository. With which project can I test?

@ctron
Copy link
Owner

ctron commented Feb 17, 2015

Hm ... ok, so you have to deploy the bundles and features. Not the target platform and not the repository/product.

Using the test projects, a simply mvn deploy in test.parent works for me. But you need to add a server mapping in your .m2/settings.xml:

…
<server>
   <id>pdrone.test</id>
   <username></username>
   <password>deploy-key</password> <!-- change to the actual deploy key assigned to the channel -->
</server>
…

@toshovski
Copy link
Author

Okay.. So I added a new group, then I added a key to it and finally added the group to the channel. In settings.xml I set the deploy key 510E8BE7-0CED-4A10-907F-DBDF65628216 (see screenshot). However it still fails with error 503. The link http://localhost:8080/maven/p2/ in browser shows that there the p2 repository is empty-

image

i also changed the parent pom like this:

        <distributionManagement>
                <repository>
                        <id>p2</id>
                        <url>http://localhost:8080/maven/p2</url>
                </repository>
        </distributionManagement>

settings.xml:

                <server>
                   <id>p2</id>
                   <username></username>
                   <password>510E8BE7-0CED-4A10-907F-DBDF65628216</password> <!-- change to the actual deploy key assigned to the channel -->
                </server>

@ctron
Copy link
Owner

ctron commented Feb 17, 2015

Ok, the deploy key is not 510E8BE7-0CED-4A10-907F-DBDF65628216, but the string you see when you click on the group 3C40C00F-… and locate the entry in the list.

pdrone_dpk

This cries for documentation :(

@toshovski
Copy link
Author

Maybe you should hide the black id's from the key list and add a new column with the access key. I fixed this issue, but now I get error 401: Unauthorized. Are you sure that there should be no username in the settings?

@ctron
Copy link
Owner

ctron commented Feb 17, 2015

Yes, I guess this whole UI needs a bit of work.

The token can either be put as username or password.

I remember having an issue with Maven, running an external Maven setup from inside Eclipse caused troubles. While the embedded version worked.

I will try to check this.

@ctron
Copy link
Owner

ctron commented Feb 17, 2015

Ok, so plain maven seems to use BasicRepositoryConnector while the embedded maven uses AetherRepositoryConnector.

Aether works as expected while the Basic Connector does not authenticate properly. sigh

I need to check this, sorry!

@ctron
Copy link
Owner

ctron commented Feb 17, 2015

Ok, I found out what goes wrong. Plain Maven uses BasicRepositoryConnector, which totally removes the authentication credentials of any of username or password is an empty string.

Using Maven embedded in Eclipse works though, since they use Aether which just takes what was provides as username and password.

So I will change Package Drone that the default username will always be "deploy".

ctron added a commit that referenced this issue Feb 18, 2015
This change should provide a better view on how deploy keys
are used with Maven.
ctron added a commit that referenced this issue Feb 18, 2015
notify the user when there are not deploy groups created or assigned.
@larkery
Copy link

larkery commented Feb 18, 2015

Is the requirement of the deploy username present in the debian package version 0.1.4 (installed as of just now)? I have followed a similar process, and have an auth failure when doing mvn deploy (username is deploy and password is the key).

Edit: I have used my brain and done a differential diagnosis by doing the deploy within eclipse, which works, hence I infer not.

@ctron
Copy link
Owner

ctron commented Feb 18, 2015

No, this handling is not present in 0.1.4. It will be in 0.1.5!

I hope I can release this version today. But I don't want to make any promises, since I need to finish something else first.

@larkery
Copy link

larkery commented Feb 18, 2015

Thanks!

@ctron ctron modified the milestones: v0.1.5, v0.1.4 Feb 18, 2015
@ctron ctron added the bug label Feb 18, 2015
@ctron
Copy link
Owner

ctron commented Feb 18, 2015

Ok, so the release (0.1.5) is out. Docker images are updated, as are the YUM and APT repos.

So with a:

docker pull ctron/package-drone:latest
docker run -p 8080:8080 -a stdin -a stdout -a stderr -i -t ctron/package-drone:latest

I have Package Drone 0.1.5 running to which I can deploy using:

mvn deploy -DaltDeploymentRepository=thedrone::default::http://deploy:deploy-key-change-me@localhost:8080/maven/channel-change-me

@ctron
Copy link
Owner

ctron commented Feb 18, 2015

So I will close this. If it still causes problems, please re-open it.

I guess I owe you some 🍻 ;-)

@ctron ctron closed this as completed Feb 18, 2015
@toshovski
Copy link
Author

I'm really happy to help. The project is really promising. I'll try the fix tomorrow.

@toshovski
Copy link
Author

So I changed my settings.xml and the pom file like suggested. The command mvn deploy still doesn't work (see error). I have to explicit tell where to deploy the artifact using the suggested from you command.

mvn deploy -DaltDeploymentRepository=thedrone::default::http://deploy:deploy-key-change-me@localhost:8080/maven/channel-change-me

Error by using maven deploy:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project parent: Failed to deploy artifacts: Could not transfer artifact de.dentrassi:parent:pom:1.0.0-20150219.085056-1 from/to pdrone (http://localhost:8080/maven/p2/): Failed to transfer file: http://localhost:8080/maven/p2/de/dentrassi/parent/1.0.0-SNAPSHOT/parent-1.0.0-20150219.085056-1.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]

@ctron
Copy link
Owner

ctron commented Feb 19, 2015

So it works with the "altDeploymentRepository" argument, but not with the settings.xml?

This could only mean that there is something wrong in the configuration. At least maven does not seem to find the server credentials.

@toshovski
Copy link
Author

Sorry. It was my mistake.

@ctron
Copy link
Owner

ctron commented Feb 19, 2015

So I am just glad it wasn't me 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants