ctron / package-drone

An OSGI first software artifact repository – Moved to the Eclipse Foundation
https://github.com/eclipse/packagedrone
Eclipse Public License 1.0
39 stars 13 forks source link

P2 repo is always empty #82

Closed SvenEwald closed 9 years ago

SvenEwald commented 9 years ago

Using PD 0.7.3 I tried the following:

I excpected to directly see these bundles when I use the P2 Url in eclipse as update site. But that did not work, in fact the files content.xml & artifacts.xml were present, but near empty. (containing no reference to any bundle)

I retried with all combinations of OSGI aspects, but the P2 repo seems to be empty every time.

What did I miss? Did I use it wronly?

ctron commented 9 years ago

You do need to add the "P2 Metadata" aspect if you did not deploy P2 Metadata with Maven Tycho.

In the end the P2 repository task does require artifacts of type "P2 Metadata/Artifact Fragment" to build up the repository. These can be provided either by deploying them with Maven Tycho, or by generating them using the "P2 Metadata" aspect.

SvenEwald commented 9 years ago

Sorry for not making this clear, i tried with the "P2 Metadata Generator" aspect. Here the content of the aspects file of the exported channel:

cleanup
hasher
mime
osgi
p2.metadata
p2.repo
p2.unzip

So me was right about the expection to see all deployed bundles in a channel in the contents.xml and artifacts.xml. What data do you need to debug?

ctron commented 9 years ago

Ok, this is strange!

If you can, it would be good to have the export of the channel. So I can import it here and see what causes the trouble.

If you don't like to post the ZIP file here, you can also send me a direct like (or Google docs, Wuala, …) directly by e-mail (which is in my profile).

In version 0.7.x there is still no validation of content, so something might be broken from a content perspective which causes this. In 0.8.x there will be a validation mechanism which can make one aware of troublesome content.

SvenEwald commented 9 years ago

Just tried clearing the channel, manually deploy some org.eclipse.xtext.*.jar. But content.xml just looks just like this:

<?metadataRepository version="1.1.0"?>
<repository name="pttd" type="org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository" version="1">
<properties size="1">
<property name="p2.timestamp" value="1430996629139"/>
</properties>
</repository>

(exported channel on it's way via email)

ctron commented 9 years ago

I just got it. Thanks.

I know this does not help, but it works for me. So importing the channel provided the result I would expect. I also tried this with the instance of "thedrone" and it works there as well [1]. I will delete this channel later today. But it seemed pretty standard anyway.

I am not sure what is wrong I have to admit. I will look a bit further into this.

Do you have the file system BLOB store enabled? Can you trigger "Maintenance" -> "Refresh" in the channel view, just in case.

[1] http://thedrone.packagedrone.org/channel/2F1128DD-4BF9-4739-8E18-DF6D6C0015A4/view

SvenEwald commented 9 years ago

I tried the refresh, but did not change the result. I can see that it worked in the URL you gave, so I really like to dig into this and get this running. JDK is 1.8.45, DB is postgres 9, OSGI console does not show stacktraces or errors. I just followed the short "manual installation" path, not activating file system BLOBs. How do I activate it?

SvenEwald commented 9 years ago

Found out about the file system BLOBs. Activated, but result is same.

ctron commented 9 years ago

I just added this to the wiki page about the filesystem blob store [1]. Which is a good thing anyway.

I did my test with MySQL, although there is postgres running on "thedrone". So this should not be an issue either.

Which operating system are you using?

[1] https://github.com/ctron/package-drone/wiki/File-system-BLOB-store#how-to-activate-it

ctron commented 9 years ago

Ok ... good in some way :wink:

So the only thing which would prevent the process from adding it would be that it does not detect the fragment type. Could you please check the meta data field p2.repo:fragment-type on the p2*.xml files. And also the field mime:type.

SvenEwald commented 9 years ago
pd@BUILDHOST:~/package-drone-server-0.7.3> cat /etc/issue
Welcome to DSA PRODIS Server with SuSE Linux 11.34 (x86_64) - Kernel \r (\l).
pd@BUILDHOST:~/package-drone-server-0.7.3> uname -a
Linux BUILDHOST 3.0.31-0.9-default #1 SMP Tue May 22 21:44:30 UTC 2012 (2dc3831) x86_64 x86_64 x86_64 GNU/Linux

The filesystem storage seems to work, there is a dir with stuff in it at the expected location.

the file org.eclipse.ant.optional.junit_3.2.200-p2artifacts.xml:

<artifacts size="1">
<artifact classifier="osgi.bundle" id="org.eclipse.ant.optional.junit" version="3.2.200">
<properties size="4"><property name="download.md5" value="138c33ac07b8cf81a63a78fb661bfa8a"/>
<property name="download.size" value="1311"/>
<property name="artifact.size" value="1311"/>
<property name="drone.artifact.id" value="0ADB1F76-C9F1-4D4A-9088-B952E406CB20"/>
</properties>
</artifact>
</artifacts>

and org.eclipse.ant.optional.junit_3.2.200-p2artifacts.xml:

<units size="1">
<unit id="org.eclipse.ant.optional.junit" singleton="false" version="3.2.200">
<update id="org.eclipse.ant.optional.junit" range="[0.0.0,3.2.200)" severity="0"/>
<properties size="3"><property name="org.eclipse.equinox.p2.name" value="%pluginName"/>
<property name="org.eclipse.equinox.p2.bundle.localization" value="plugin"/>
<property name="org.eclipse.equinox.p2.provider" value="%providerName"/>
</properties>
<provides size="3">
<provided name="bundle" namespace="org.eclipse.equinox.p2.eclipse.type" version="1.0.0"/>
<provided name="org.eclipse.ant.optional.junit" namespace="org.eclipse.equinox.p2.iu" version="3.2.200"/>
 <provided name="org.eclipse.ant.optional.junit" namespace="osgi.bundle" version="3.2.200"/>
</provides><requires size="2">
<required name="org.eclipse.core.runtime.compatibility" namespace="osgi.bundle" range="0.0.0"/>
<required name="org.junit" namespace="osgi.bundle" range="0.0.0"/>
 </requires>
<artifacts size="1">
<artifact classifier="osgi.bundle" id="org.eclipse.ant.optional.junit" version="3.2.200"/>
</artifacts>
<touchpoint id="org.eclipse.equinox.p2.osgi" version="1.0.0"/>
<touchpointData size="1">
<instructions size="1">
<instruction key="manifest">Manifest-Version: 1.0
 Bundle-SymbolicName: org.eclipse.ant.optional.junit
 Bundle-Version: 3.2.200
</instruction>
</instructions>
</touchpointData>
</unit>
</units>
ctron commented 9 years ago

Hm, ok ...

can you navigate to the artifact itself (p2*.xml), select "Details" and switch over to the "Metadata" tab. Looking up:

Because at some point these two fields control if the files will be part of the final collection.

SvenEwald commented 9 years ago

Artifact org.eclipse.ant.optional.junit_3.2.200-p2artifacts.xml: mime type text/xml

Can not find p2.repo:fragment-type anywhere. Neither in the metadata for the bundle, nor for the p2*.xml files.

ctron commented 9 years ago

Damn .. this is the problem. The processors only look for application/xml to identify XML files. This seems to work on Ubuntu, Debian and RedHat systems. Seems like Suse is special :wink:

Seems like both definitions are ok for XML files. So I do need to make the test a little bit more flexible.

So you have any chance to test on Ubuntu, Debian or RedHat/CentOS on the moment?

ctron commented 9 years ago

So this clearly is a bug in Package Drone.

SvenEwald commented 9 years ago

Will try on Debian. Before, I tried running on Windows with no success. Generated JSP files did not compile due to class resolving issues... never mind ;-)

ctron commented 9 years ago

Yes, Windows is untested and pretty sure unsupported. Sorry for that.

ctron commented 9 years ago

The next version will have a fix. However the next version is planned to be 0.8.0, which will take a bit longer since there are a few new feature which need more work.

SvenEwald commented 9 years ago

Needed to drop & recreate the database, but now it works on Debian :+1: Thanks a lot for your support!!!

ctron commented 9 years ago

Ok, I guess re-creating the channel would have been sufficient, but that works as well :smile:

Thank you for helping in finding this issue. I will keep this bug open until there is a release which fixes this one.

Thanks!

ctron commented 9 years ago

So this one should be closed.