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

Unable to push publish plugins #21568

Closed
swicken-dotcms opened this issue Jan 20, 2022 · 12 comments · Fixed by #21974 or #22031
Closed

Unable to push publish plugins #21568

swicken-dotcms opened this issue Jan 20, 2022 · 12 comments · Fixed by #21974 or #22031

Comments

@swicken-dotcms
Copy link
Contributor

swicken-dotcms commented Jan 20, 2022

Describe the bug
Attempting to push publish plugins results in an error attempting to generate a directory

[20/01/22 14:43:49:427 UTC]  INFO publishing.PublisherAPIImpl: Start of Bundler: OSGIBundler
[20/01/22 14:43:49:445 UTC] ERROR publishing.PublisherAPIImpl: com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler : generate()Destination '/osgiBundles/com.dotcms.rest-osgi-debug-0.2.jar' directory cannot be created: Unable to pull content
com.dotcms.publishing.DotBundleException: com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler : generate()Destination '/osgiBundles/com.dotcms.rest-osgi-debug-0.2.jar' directory cannot be created: Unable to pull content
	at com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler.generate(SourceFile:119) ~[ee-22.01.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl.publish_aroundBody0(PublisherAPIImpl.java:118) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl$AjcClosure1.run(PublisherAPIImpl.java:1) ~[dotcms_22.01_999999.jar:?]
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.9.2.jar:?]
	at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.aspects.interceptors.CloseDBIfOpenedMethodInterceptor.invoke(CloseDBIfOpenedMethodInterceptor.java:29) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.aspects.aspectj.CloseDBIfOpenedAspect.invoke(CloseDBIfOpenedAspect.java:41) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl.publish(PublisherAPIImpl.java:47) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl.publish(PublisherAPIImpl.java:42) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publisher.business.PublisherQueueJob.execute_aroundBody0(PublisherQueueJob.java:186) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publisher.business.PublisherQueueJob$AjcClosure1.run(PublisherQueueJob.java:1) ~[dotcms_22.01_999999.jar:?]
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.9.2.jar:?]
	at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.aspects.interceptors.CloseDBIfOpenedMethodInterceptor.invoke(CloseDBIfOpenedMethodInterceptor.java:29) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.aspects.aspectj.CloseDBIfOpenedAspect.invoke(CloseDBIfOpenedAspect.java:41) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publisher.business.PublisherQueueJob.execute(PublisherQueueJob.java:112) ~[dotcms_22.01_999999.jar:?]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:223) ~[dot.quartz-all-1.8.6_2.jar:?]
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) ~[dot.quartz-all-1.8.6_2.jar:?]
Caused by: java.io.IOException: Destination '/osgiBundles/com.dotcms.rest-osgi-debug-0.2.jar' directory cannot be created
	at com.dotcms.repackage.org.apache.commons.io.FileUtils.copyFile(FileUtils.java:777) ~[dot.commons-io-2.0.1_2.jar:2.0.1]
	at com.dotcms.repackage.org.apache.commons.io.FileUtils.copyFileToDirectory(FileUtils.java:706) ~[dot.commons-io-2.0.1_2.jar:2.0.1]
	at com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler.generate(SourceFile:102) ~[ee-22.01.jar:?]
	... 17 more
[20/01/22 14:43:49:445 UTC] ERROR business.PublisherQueueJob: Unable to publish Bundle '01FSVZ34DPME6FZT8ZEE90KSXC': com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler : generate()Destination '/osgiBundles/com.dotcms.rest-osgi-debug-0.2.jar' directory cannot be created: Unable to pull content
com.dotcms.publishing.DotPublishingException: com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler : generate()Destination '/osgiBundles/com.dotcms.rest-osgi-debug-0.2.jar' directory cannot be created: Unable to pull content
	at com.dotcms.publishing.PublisherAPIImpl.publish_aroundBody0(PublisherAPIImpl.java:154) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl$AjcClosure1.run(PublisherAPIImpl.java:1) ~[dotcms_22.01_999999.jar:?]
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.9.2.jar:?]
	at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.aspects.interceptors.CloseDBIfOpenedMethodInterceptor.invoke(CloseDBIfOpenedMethodInterceptor.java:29) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.aspects.aspectj.CloseDBIfOpenedAspect.invoke(CloseDBIfOpenedAspect.java:41) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl.publish(PublisherAPIImpl.java:47) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl.publish(PublisherAPIImpl.java:42) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publisher.business.PublisherQueueJob.execute_aroundBody0(PublisherQueueJob.java:186) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publisher.business.PublisherQueueJob$AjcClosure1.run(PublisherQueueJob.java:1) ~[dotcms_22.01_999999.jar:?]
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.9.2.jar:?]
	at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.aspects.interceptors.CloseDBIfOpenedMethodInterceptor.invoke(CloseDBIfOpenedMethodInterceptor.java:29) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.aspects.aspectj.CloseDBIfOpenedAspect.invoke(CloseDBIfOpenedAspect.java:41) ~[dotcms_22.01_999999.jar:?]
	at com.dotcms.publisher.business.PublisherQueueJob.execute(PublisherQueueJob.java:112) ~[dotcms_22.01_999999.jar:?]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:223) ~[dot.quartz-all-1.8.6_2.jar:?]
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) ~[dot.quartz-all-1.8.6_2.jar:?]
Caused by: com.dotcms.publishing.DotBundleException: com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler : generate()Destination '/osgiBundles/com.dotcms.rest-osgi-debug-0.2.jar' directory cannot be created: Unable to pull content
	at com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler.generate(SourceFile:119) ~[ee-22.01.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl.publish_aroundBody0(PublisherAPIImpl.java:118) ~[dotcms_22.01_999999.jar:?]
	... 16 more
Caused by: java.io.IOException: Destination '/osgiBundles/com.dotcms.rest-osgi-debug-0.2.jar' directory cannot be created
	at com.dotcms.repackage.org.apache.commons.io.FileUtils.copyFile(FileUtils.java:777) ~[dot.commons-io-2.0.1_2.jar:2.0.1]
	at com.dotcms.repackage.org.apache.commons.io.FileUtils.copyFileToDirectory(FileUtils.java:706) ~[dot.commons-io-2.0.1_2.jar:2.0.1]
	at com.dotcms.enterprise.publishing.remote.bundler.OSGIBundler.generate(SourceFile:102) ~[ee-22.01.jar:?]
	at com.dotcms.publishing.PublisherAPIImpl.publish_aroundBody0(PublisherAPIImpl.java:118) ~[dotcms_22.01_999999.jar:?]
	... 16 more
[20/01/22 14:43:49:445 UTC]  INFO util.PushPublishLogger: class com.dotcms.publisher.business.PublisherQueueJob : Status Update: Failed to bundle '01FSVZ34DPME6FZT8ZEE90KSXC'

Reproduced on: 21.06.6, 22.01
Related Ticket: https://dotcms.zendesk.com/agent/tickets/106313

To Reproduce

  1. Create a sender/receiver environment
  2. Add a plugin to the sender
  3. Attempt to push publish that plugin

Expected behavior
The plugin should push successfully.

discussion #21590

@wezell
Copy link
Contributor

wezell commented Jan 21, 2022

This does not work in docker environments. When bundling OSGI plugins, we should use a subfolder of the normal /asset/bundle folder as that folder has the proper permissions, is shared and gets automatically cleaned up etc...

@freddyucv
Copy link

Hey team! Please add your planning poker estimate with ZenHub @dsilvam @victoralfaro-dotcms

@bryanboza
Copy link
Contributor

bryanboza commented Feb 17, 2022

Hey guys I have a couple of questions here that maybe we need to take in consideration...

Does this work with the OSGI, static ones or both?

Also, what should expect in case you already have the plugin in the receiver side, should we have integrity checker for plugins? or just should replace the existing one without confirmation ?

Taking in consideration this change can broke some features in case of a wrong configuration, maybe at least we should create a new property to enable/disable permissions to override the configuration.

@swicken-dotcms
Copy link
Contributor Author

Additional ticket: https://dotcms.zendesk.com/agent/tickets/106537

victoralfaro-dotcms added a commit that referenced this issue Feb 18, 2022
…tead. Json serializing instead of xml for OSGi push publish.
victoralfaro-dotcms added a commit that referenced this issue Feb 18, 2022
…tead. Json serializing instead of xml for OSGi push publish.
@victoralfaro-dotcms
Copy link
Contributor

victoralfaro-dotcms commented Feb 18, 2022

victoralfaro-dotcms added a commit that referenced this issue Feb 24, 2022
…ing, centralizing ObjectMapper and XStream instances to one and addind plugin case to Dependency manager.
@wezell wezell added the LTS: Needs Backport Ticket that will be added to LTS label Feb 24, 2022
@erickgonzalez
Copy link
Contributor

Need to test in 5.3.8 series, probably not needed since was introduced with the changes in PP (21.05ish)

victoralfaro-dotcms added a commit that referenced this issue Feb 28, 2022
…ing, centralizing ObjectMapper and XStream instances to one and addind plugin case to Dependency manager.
victoralfaro-dotcms added a commit that referenced this issue Feb 28, 2022
…ing, centralizing ObjectMapper and XStream instances to one and addind plugin case to Dependency manager.
victoralfaro-dotcms added a commit that referenced this issue Mar 1, 2022
…ing, centralizing ObjectMapper and XStream instances to one and addind plugin case to Dependency manager.
victoralfaro-dotcms added a commit that referenced this issue Apr 6, 2022
…ing, centralizing ObjectMapper and XStream instances to one and addind plugin case to Dependency manager.
dsilvam pushed a commit that referenced this issue Apr 6, 2022
…ing, centralizing ObjectMapper and XStream instances to one and addind plugin case to Dependency manager. (#21974)
@dsilvam
Copy link
Contributor

dsilvam commented Apr 6, 2022

@freddyucv
Copy link

Pass Internal QA

it was test with this plugins: https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.rest

  • Start the sender in 8080 port.
  • Start receiver in 8090 port.
  • Upload the bundle in the sender.
  • Test the Plugins with: curl -XPUT http://localhost:8080/api/example
    Response: {"result":"anonymous user anonymous PUT!"}
  • Test the Plugins with: curl --head -XPUT http://localhost:8090/api/example
    Response: 404 HTTP Code
  • PP the Plugins to the receiver
  • Test Again the Plugins with: curl --head -XPUT http://localhost:8090/api/example
    Response: {"result":"anonymous user anonymous PUT!"}
  • Change the code here:

https://github.com/dotCMS/plugin-seeds/blob/master/OSGi/com.dotcms.rest/src/main/java/com/dotcms/plugin/rest/ExampleResource.java#L36

Change " PUT!" by " PUT! With changes"

  • Upload the bundle again in the sender and PP it to the receiver
  • Now test with: curl -XPUT http://localhost:8090/api/example
    Response: {"result":"anonymous user anonymous PUT! With changes"}

@freddyucv
Copy link

freddyucv commented Apr 11, 2022

Hey guys I have a couple of questions here that maybe we need to take in consideration...

Does this work with the OSGI, static ones or both?

Also, what should expect in case you already have the plugin in the receiver side, should we have integrity checker for plugins? or just should replace the existing one without confirmation ?

Taking in consideration this change can broke some features in case of a wrong configuration, maybe at least we should create a new property to enable/disable permissions to override the configuration.

About this one: "Taking in consideration this change can broke some features in case of a wrong configuration, maybe at least we should create a new property to enable/disable permissions to override the configuration."

This is a bug is not a new issue

About this one: "Also, what should expect in case you already have the plugin in the receiver side, should we have integrity checker for plugins? or just should replace the existing one without confirmation ?"

This replace the existing one, this have the same behavior in the sender when you change a Plugin and Upload this again, so I think it is right.

About this one: "Does this work with the OSGI, static ones or both?"

the static plugins are deprecated

@freddyucv freddyucv removed their assignment Apr 11, 2022
@bryanboza
Copy link
Contributor

We need some work here, every time you push any plugin we are getting this error in the log:
https://gist.github.com/bryanboza/b40712d8d129c0fc8518288b3493d7c9

@bryanboza
Copy link
Contributor

Fixed, tested on release-22.06 and now we don't have the error in the log

@swicken-dotcms
Copy link
Contributor Author

Will not be backporting to LTS releases due to changes to bundle manifest files and an upgrade task requirement

@swicken-dotcms swicken-dotcms added LTS: Excluded Ticket that has been excluded from at least one LTS and removed LTS: Needs Backport Ticket that will be added to LTS LTS: Priority labels Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants