Artifactory generates 0 byte package json for NPM artifact - artifactory

I am facing an odd situation where the initial npm publication went fine. But when moving/promoting the artifact to another local npm repository, which does not contain an artifact yet for this artifact; artifactory succesfully moves the artifact. But fails with creating the corresponding package.json.
In the artifactory-service.log we see the following message:
2023-01-12T09:11:52.521Z [jfrt ] [INFO ] [c8198335dc788640] [.NpmPackageMetadataIndexer:402] [art-exec-24 ] - Preparing to write npm package metadata for repo 'npm_releases' on path '.npm/#<group>/<artifactid>/package.json' 2023-01-12T09:11:52.540Z [jfrt ] [ERROR] [494934d19384b919] [j.r.n.PackageMetadataStream:68] [art-fixed-$s ] - Failed write java.lang.RuntimeException: Failed precondition. List argument metadata must not be empty at org.jfrog.repomd.npm.util.NpmUtils.updateAndGetLatest(NpmUtils.java:107) at org.jfrog.repomd.npm.util.NpmUtils.updateAndGetLatest(NpmUtils.java:100) at org.jfrog.repomd.npm.PackageMetadataStream.calculateLatest(PackageMetadataStream.java:128) at org.jfrog.repomd.npm.PackageMetadataStream.buildGroupMetadata(PackageMetadataStream.java:99) at org.jfrog.repomd.npm.PackageMetadataStream.writeInternal(PackageMetadataStream.java:77) at org.jfrog.repomd.npm.PackageMetadataStream.write(PackageMetadataStream.java:66) at org.iostreams.streams.in.OutputToInputStream$1.call(OutputToInputStream.java:140) at org.iostreams.streams.in.OutputToInputStream$1.call(OutputToInputStream.java:136) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.artifactory.opentracing.TraceableRunnableDecorator.run(TraceableRunnableDecorator.java:40) at org.artifactory.concurrent.ArtifactoryRunnable.run(ArtifactoryRunnable.java:53) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) 2023-01-12T09:11:52.565Z [jfrt ] [INFO ] [c8198335dc788640] [.NpmPackageMetadataIndexer:412] [art-exec-24 ] - Finished writing npm package metadata for repo 'npm_releases' on path '.npm/#<group>/<artifactid>/package.json
I do not see how this relates to the uploaded artifact. As the generation of the package.json for the initial publication went fine. Next to this stacktrace I could not find anything in the log which relates to this.
I am able to reproduce this problem with artifactory version: 7.46.11 and 7.49.5
Could someone help explaining in what Failed precondition. List argument metadata must not be empty at means? And how to mitigate this situation?
I tried moving this artifact to other local npm repositories with same result. For unclear reasons in a populated repository as in a local npm repository(lets say the original repository which worked) which contains 3 artifacts with a different version number, but same group and artifactid a valid package.json was generated. This should work for this single artifact as well, but it doesn't.

Related

artifactory don't start with an illegal repo name

I have an illegal repository name, which starts with a number.
It's an old repo, created with API request (in Artifactory 6.5.1 version)
Artifactory accepts illegal name with API requests but if you restart artifactory, it's down
So my problem is the same like here:
https://www.jfrog.com/jira/browse/RTFACT-16669
Except the solution doesn't work for me.
Because my instance/server is new, so i have not this file $ARTIFACTORY_HOME/etc/artifactory.config.latest.xml with the local repository.
I have repositories on AWS S3 and a AWS RDS database
And my new AWS EC2 instance have to get repos on S3
My question is:
Can i start artifactory ignoring the bad repo ?
Or
Can i delete the repo without starting artifactory ? (without API request or GUI)
The logs are here:
2019-05-13 14:37:11,581 [art-init] [ERROR] (o.a.c.CentralConfigServiceImpl:744) - Could not load configuration due to: Failed to read object from stream
java.lang.RuntimeException: Failed to read object from stream
at org.artifactory.jaxb.JaxbHelper.read(JaxbHelper.java:131)
at org.artifactory.jaxb.JaxbHelper.readConfig(JaxbHelper.java:66)
at org.artifactory.descriptor.reader.CentralConfigReader.readAndConvert(CentralConfigReader.java:76)
etc ...
Caused by: javax.xml.bind.UnmarshalException: null
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:335)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:578)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:264)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:229)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:125)
at org.artifactory.jaxb.JaxbHelper.read(JaxbHelper.java:129)
... 56 common frames omitted
Caused by: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '0ta' is not a valid value for 'NCName'.
etc ...
[art-init] [ERROR] (o.a.w.s.ArtifactoryContextConfigListener:96) - Application could not be initialized: null
java.lang.reflect.InvocationTargetException: null
etc ...
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'org.artifactory.security.access.AccessService'.; nested exception is com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException
etc ...
[http-nio-8081-exec-2] [ERROR] (o.a.w.s.ArtifactoryFilter:194) - Artifactory failed to initialize: Context is null
Thanks
Cyril
The Artifactory config descriptor is stored in the Artifactory DB schema under a table named configs.
In order to overcome this, you can do the following:
Extract the artifactory.config.xml config from the configs table
Store the extracted configuration as a file in: $ARTIFACTORY_HOME/etc/artifactory.config.import.xml
Edit the artifactory.config.import.xml file and manually fix/delete the '0ta' repository reference from the configuration file
After modifying the descriptor, restart the Artifactory service.
Note, if you already have artifacts assigned to the illegal repo name, you will not be able to see them after modifying the repository name, however, since it is a new installation, I'm not sure that that this is relevant for you.

Opendaylight netconf-testtool build failed

Hi I tried to clone the repository and build the source as mentioned in the opendaylight wiki page. But the build is failing.
Link: https://wiki.opendaylight.org/view/OpenDaylight_Controller:Netconf:Testtool#Building_testtool
The following are the steps I followed:
Check out latest netconf repository from git
Dive into netconf/netconf/tools/netconf-testtool/ folder
Build testtool using mvn clean install command
The build fails with the following error trace:
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.opendaylight.netconf:netconf-parent:1.5.0-SNAPSHOT: Could not find artifact org.opendaylight.mdsal:binding-parent:pom:0.13.0-SNAPSHOT and 'parent.relativePath' points at no local POM # org.opendaylight.netconf:netconf-parent:1.5.0-SNAPSHOT, /home/balakrishnan/netconf_simulator/netconf/netconf/netconf-parent/pom.xml, line 11, column 11
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.opendaylight.netconf:netconf-testtool:1.5.0-SNAPSHOT (/home/balakrishnan/netconf_simulator/netconf/netconf/tools/netconf-testtool/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.opendaylight.netconf:netconf-parent:1.5.0-SNAPSHOT: Could not find artifact org.opendaylight.mdsal:binding-parent:pom:0.13.0-SNAPSHOT and 'parent.relativePath' points at no local POM # org.opendaylight.netconf:netconf-parent:1.5.0-SNAPSHOT, /home/balakrishnan/netconf_simulator/netconf/netconf/netconf-parent/pom.xml, line 11, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
The build needs artifacts which your Maven setup doesn’t know about. You need to edit your settings.xml file; if you’re running in a Unix-style environment:
cp -n ~/.m2/settings.xml{,.orig}
wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
This will configure Maven to download OpenDaylight artifacts from the OpenDaylight Nexus repositories; you will then be able to build netconf-testtool directly.
You need to build the entire netconf project (ie mvn install) from the top-down.

How to fake flyway migration?

Two of us made a migration script in different GIT branches. Now, I've pulled origin development branch, and I've corrected GIT merge issues, and renamed my migration script to be the last. So, the new initialization of DB and migration of DB from version of develop branch would be fine.
However, I've got a lot of data in my local testing DB, so I've manually applied new migration scripts that I've pulled in GIT. However, I can't make flyway think, that everything is okay.
So, How can I fake migrations?
When I try to migrate, I get following error:
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:3.2.1:migrate (default-cli) on project db: org.flywaydb.core.api.FlywayException: Validate failed. Migration Description mismatch for migration 1.118
[ERROR] -> Applied to database : AAA
[ERROR] -> Resolved locally : BBB
[ERROR] -> [Help 1]
You will have to manually update Flyway's metadata table (called schema_version by default)

Installing SystemML from MVN/GitHub?

SystemML is available on https://github.com/SparkTC/systemml
How do I get it started with? I am newbie to GitHub.
I created a directory in my Ubuntu and copied the POM.xml file - when I issued mvn clean package, I am getting the error:
mvn clean package
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.ibm.systemml:systemml-parent:5.2-SNAPSHOT (/home/vmuser/system-ml/pom.xml) has 1 error
[ERROR] Child module /home/vmuser/system-ml/system-ml of /home/vmuser/system-ml/pom.xml does not exist
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
When I went to R and issued the following command on R 64 bit ver 3.1.1, I got error too:
> install.packages(c("batch", "bitops", "boot", "caTools", "data.table", "doMC", "doSNOW", "ggplot2", "glmnet", "lda", "Matrix", "matrixStats", "moments", "plotrix", "psych", "reshape", "topicmodels", "wordcloud", "methods"), dependencies=TRUE)
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/3.1
Warning: package ‘methods’ is in use and will not be installed
Warning message:
packages ‘batch’, ‘bitops’, ‘boot’, ‘caTools’, ‘data.table’, ‘doMC’, ‘doSNOW’, ‘ggplot2’, ‘glmnet’, ‘lda’, ‘Matrix’, ‘matrixStats’, ‘moments’, ‘plotrix’, ‘psych’, ‘reshape’, ‘topicmodels’, ‘wordcloud’ are not available (for R version 3.1.1)
>
The error message you received tells you what the problem is (formatting mine):
The project com.ibm.systemml:systemml-parent:5.2-SNAPSHOT (/home/vmuser/system-ml/pom.xml) has 1 error
Child module /home/vmuser/system-ml/system-ml of /home/vmuser/system-ml/pom.xml does not exist
You said:
I created a directory in my Ubuntu and copied the POM.xml file
You don't just need the pom.xml file; you need the whole project. Either git clone it or download the source as a zip and extract it, then run mvn clean package from the project directory.
git clone is a better option if you intend to modify the source code. It will give you some powerful tools for integrating upstream changes and for submitting your modifications to the parent project. If you just want to use the project as-is, either option should be fine.
SystemML became an Apache (incubating) project in November of 2015. Its main website is located at http://systemml.apache.org/. The project can now be found on GitHub at https://github.com/apache/incubator-systemml.
Probably the quickest way to get started with Apache SystemML is to download a pre-built release package from the Apache SystemML Downloads page (see the main website). Information about Apache SystemML can be found at the Apache SystemML Documentation site, which is linked to from the main site. This includes information about running SystemML in notebooks, on Spark, and on Hadoop.
If you would like to clone the SystemML repository and build it locally with Maven, instructions to do so can be found in the project README on GitHub.

sbt-release plugin logs git push as error, despite it succeeding

I am using the sbt-release plugin.
The process seems to work, however, sbt logs the final release step, pushChanges as error. Ideally, only actual errors are logged to error output as it can confuse the automation.
Sample output here:
Push changes to the remote repository (y/n)? [y] y
[error] To git#git.mycompany.com:gsilin/s3-client.git
[error] 67277ef..a1b959f my_branch -> my_branch
[error] To git#git.mycompany.com:gsilin/s3-client.git
[error] * [new tag] v0.1.8 -> v0.1.8
my_branch in this case is not the master branch (as I'm testing this process on my own branch before it goes to master), could that be the issue?
I don't know if something's changed in the latest version, but before sbt-release was warning you before this push step, that git sends it's info on stderr and so it will be shown with error messages in sbt although the process goes perfectly fine. So it's ok, don't worry.

Resources