madhu yedla
madhu yedla

Reputation: 1

How to check that the artifactory cleanup plugin is working as exepected?

We executed curl command to ran the cleanup plugin, but it didn't display any results

Enabled the logger name in "/opt/jfrog/artifactory/var/etc/artifactory/logback.xml" and executed the curl command to ran the artifactsCleanup plugin.

Curl command is executing successfully, but not sure whether it’s really doing any cleanup as there are no cleanup results in the output.

And nothing is written to the cleanup log file.

-rw-r----- 1 0 Jun 22 15:50 artifactory-cleanup.log

======================

$ curl -X POST -v -u admin:password "http://localhost:8082/artifactory/api/plugins/execute/cleanup?params=timeUnit=month;timeInterval=1;repos=libs-release-local;dryRun=true;paceTimeMS=2000;disablePropertiesSupport=true" Trying 127.0.0.1:8082... Connected to localhost (127.0.0.1) port 8082 (#0) Server auth using Basic with user 'admin' POST /artifactory/api/plugins/execute/cleanup?params=timeUnit=month;timeInterval=1;repos=libs-release-local;dryRun=true;paceTimeMS=2000;disablePropertiesSupport=true HTTP/1.1 Host: localhost:8082 Authorization: Basic xxxxxxxxxxxxx User-Agent: curl/7.74.0 Accept: / Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Content-Length: 0 Connection #0 to host localhost left intact

===========

We have enabled the logger and specified the level to "info" as mentioned below,

<logger name="artifactCleanup" level="info"/>

I can see only below information in the artifactory-service.log, after running the above mentioned curl command for running the cleanup plugin.

==========================

2021-06-25T09:00:27.941Z [jfrt ] [INFO ] [6e717cba6e9f053f] [a.e.EventsLogCleanUpService:69] [art-exec-1 ] - Starting cleanup of old events from event log 2021-06-25T09:00:32.644Z [jfrt ] [INFO ] [6e717cba6e9f053f] [.e.EventsLogCleanUpService:100] [art-exec-1 ] - Cleanup of old events from event log finished 2021-06-25T09:59:50.385Z [jfrt ] [INFO ] [49a51a47e4f692d6] [aseBundleCleanupServiceImpl:84] [art-exec-5 ] - Starting to cleanup incomplete Release Bundles 2021-06-25T09:59:50.404Z [jfrt ] [INFO ] [49a51a47e4f692d6] [aseBundleCleanupServiceImpl:90] [art-exec-5 ] - Finished incomplete Release Bundles cleanup 2021-06-25T10:48:16.556Z [jfrt ] [INFO ] [36e8ebacb2d9e1eb] [ager$LogbackConfigWatchDog:147] [logback-watchdog ] - Reloaded logback config from: /opt/jfrog/artifactory/var/etc/artifactory/logback.xml. 2021-06-25T10:50:54.393Z [jfrt ] [INFO ] [754f8c87874506df] [o.a.a.p.PluginsAddonImpl:121 ] [http-nio-8081-exec-8] - Reloading plugins 2021-06-25T10:57:38.954Z [jfrt ] [INFO ] [ ] [ffectedConfigStreamObserver:32] [Stream_1624611588307] - publishing full invalidation and attempting to resubscribe to affected configuration changes 2021-06-25T10:57:39.563Z [jfrt ] [INFO ] [ ] [ffectedConfigStreamObserver:32] [Stream_1624611589563] - publishing full invalidation and attempting to resubscribe to affected configuration changes 2021-06-25T10:57:39.765Z [jfrt ] [INFO ] [ ] [ffectedConfigStreamObserver:32] [Stream_1624611589555] - publishing full invalidation and attempting to resubscribe to affected configuration changes 2021-06-25T10:57:41.758Z [jfrt ] [INFO ] [ ] [ffectedConfigStreamObserver:32] [Stream_1624611596743] - publishing full invalidation and attempting to resubscribe to affected configuration changes 2021-06-25T10:59:08.355Z [jfrt ] [INFO ] [ ] [ffectedConfigStreamObserver:32] [Stream_1624611588307] - publishing full invalidation and attempting to resubscribe to affected configuration changes 2021-06-25T10:59:50.386Z [jfrt ] [INFO ] [9e98497d5e8e7824] [aseBundleCleanupServiceImpl:84] [art-exec-1 ] - Starting to cleanup incomplete Release Bundles 2021-06-25T10:59:50.389Z [jfrt ] [INFO ] [9e98497d5e8e7824] [aseBundleCleanupServiceImpl:90] [art-exec-1 ] - Finished incomplete Release Bundles cleanup

====================

Reloaded the plugin as well using REST API.

curl -v -u admin:xxxxx -X POST http://localhost:8082/artifactory/api/plugins/reload

We can't see the any output whether it's really doing any cleanup or not.

Upvotes: 0

Views: 1117

Answers (2)

a. rathi
a. rathi

Reputation: 13

Assuming you are using the ArtifactCleanup User Plugin. Can you confirm if your api is running on 8082? For our Artifactory, api is running on 8081, and ui on 8082 (Artifactory version 7x). I tested the query, and this works for us.

curl -X POST -v -u admin:password "http://localhost:8081/artifactory/api/plugins/execute/cleanup?params=months=36;repos=npm-local-repo;dryRun=true;paceTimeMS=2000;disablePropertiesSupport=true"

Here we are looking for Artifacts that are not downloaded since 3 years in our npm repo.

You should see the logs in console.log file.

2021-08-10T18:18:30.226Z [jfrt ] [INFO ] [39dadab89e78897 ] [artifactCleanup:62 ] [http-nio-8081-exec-3] - Deprecated month parameter is still in use, please use the new timeInterval parameter instead! 2021-08-10T18:18:30.227Z [jfrt ] [INFO ] [39dadab89e78897 ] [artifactCleanup:160 ] [http-nio-8081-exec-3] - Starting artifact cleanup for repositories [npm-local-repo], until 36 months ago with pacing interval 2000 ms, dryrun: true, disablePropertiesSupport: true 2021-08-10T18:18:30.227Z [jfrt ] [INFO ] [39dadab89e78897 ] [artifactCleanup:173 ] [http-nio-8081-exec-3] - Removing all artifacts not downloaded since 2018/08/10 11:18

Upvotes: 0

Muhammed Kashif
Muhammed Kashif

Reputation: 1511

What is the plugin being run here? Also when the plugin was added to Artifactory was the reload plugin REST API ran? What is the curl command run and what is the output seen?

Upvotes: 0

Related Questions