Can't replace XWiki logo

Hello!

I ended up with writing here because I don’t know what else can I try.

I am not able to replace the logo of XWiki with our enterprise logo. My XWiki version is 14.10.6 running in RedHat OpenShift (k8s).
At the main Wiki I am able to upload the image, it even saves in the skin configuration, it is shown as selected, but I still have XWiki logo. I tried to make changes in the default skin config and make a new one - no difference. I tried to view from the different browsers, machines - no matter, XWiki logo is here.

In the sub wiki it’s not even uploading the image and says “no responce from the server” and I found this garbage in OpenShift Logs:

Xwiki throws this - Caused by: java.io.IOException: Could not make directory tree to place file in. Do you have permission to write to [/usr/local/xwiki/data/store/file/mps/8/6/cb5c836ca22205714804ac3bc4cd63/attachments/8/1/1893765efd1e95898b1ac5ac899cc6/f.png] ?

If you will need the full log I can provide it later.
I tried to chmod 777 -R on the storage folder - no difference, it still throws the same.

What am I doing wrong? At the rest XWiki looks working. We are only suffering with the Active Directory Plugin just because it doesn’t work.

Thank you!

This looks like the user with which you’ve started the servlet container doesn’t have write access.

Yes, that could help.

On /usr/local/xwiki?

Currently I have a such build script, because otherwise it doesn’t launch. OpenShift runs containers with a bit different permissions rather than k8s.

FROM xwiki:lts
RUN chgrp -R 0 /usr/local/tomcat/webapps/ROOT && \
    chmod -R g=u /usr/local/tomcat/webapps/ROOT
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["xwiki"]

On /usr/local/xwiki ?

No, a few levels deeper - /usr/local/xwiki/data/store/file/

With a sub-wiki case it’s clear that this is a permission issue, but, what does happen with the main wiki? I can see the logo in selector and it is set as applied.

Hm, I tried to upload the image at the subwiki again - it uploads, appears in the selector, sets as applied, but I still have xwiki logo.

I will try to repeat it, but I was not changing anything. I even rolled it back after the chmod command.

you need to set the proper permissions at the /usr/local/xwiki level.

@vmassol

Detailed information:
    Error number 3201 in 3: Exception while saving document mps:XWiki.DefaultSkin
com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document mps:XWiki.DefaultSkin
	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:729)
	at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:259)
	at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:219)
	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2096)
	at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:298)
	at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:524)
	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:598)
	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:301)
	at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:114)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:661)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:425)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:357)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:294)
	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.xpn.xwiki.XWikiException: Error number 3234 in 3: Exception while saving attachments attachment list of document mps:XWiki.DefaultSkin
	at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachmentList(XWikiHibernateStore.java:1877)
	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:599)
	... 71 more
Caused by: com.xpn.xwiki.XWikiException: Error number 3232 in 3: Exception while saving attachment [Attachment mps:XWiki.DefaultSkin@TECH_Logo_1c_weiss.png]
	at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachment(XWikiHibernateStore.java:1948)
	at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachmentList(XWikiHibernateStore.java:1872)
	... 72 more
Caused by: com.xpn.xwiki.XWikiException: Error number 3232 in 3: Exception while saving attachment.
	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.saveAttachmentContent(FilesystemAttachmentStore.java:124)
	at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachment(XWikiHibernateStore.java:1933)
	... 73 more
Caused by: org.xwiki.store.TransactionException: Failure in onRun()
Caused by:
java.io.IOException
	Could not make directory tree to place file in. Do you have permission to write to [/usr/local/xwiki/data/store/file/mps/8/6/cb5c836ca22205714804ac3bc4cd63/attachments/8/1/1893765efd1e95898b1ac5ac899cc6/f.png] ?

	at org.xwiki.store.TransactionRunnable.run(TransactionRunnable.java:333)
	at org.xwiki.store.StartableTransactionRunnable.start(StartableTransactionRunnable.java:54)
	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.saveAttachmentContent(FilesystemAttachmentStore.java:122)
	... 74 more
Caused by: java.io.IOException: Could not make directory tree to place file in. Do you have permission to write to [/usr/local/xwiki/data/store/file/mps/8/6/cb5c836ca22205714804ac3bc4cd63/attachments/8/1/1893765efd1e95898b1ac5ac899cc6/f.png] ?
	at org.xwiki.store.FileSaveTransactionRunnable.onRun(FileSaveTransactionRunnable.java:152)
	at org.xwiki.store.TransactionRunnable.run(TransactionRunnable.java:318)
	... 76 more

Mar 9, 2023, 9:49:29 PM.940	
Caused by: java.io.IOException: Could not make directory tree to place file in. Do you have permission to write to [/usr/local/xwiki/data/store/file/mps/8/6/cb5c836ca22205714804ac3bc4cd63/attachments/8/1/1893765efd1e95898b1ac5ac899cc6/f.png] ?

There are permissions in the container:
image

We are also having an issue with Active Directory Pro Plugin. Should I open another thread?

No. I think you’re referring to https://store.xwiki.com/xwiki/bin/view/Extension/ActiveDirectoryApplication which is a paying app managed by the XWiki SAS company. This forum is the community forum, and it’s independent of any company. See https://www.xwiki.org/xwiki/bin/view/Main/Support

You should contact XWiki SAS.

Have you configured the permissions as I mentioned above?

Are you executing Tomcat as root?

Good, thank you, I have redirected question to their sales. Hope she will answer.

Tomcat is not running as a root, this is an OpenShift’s specifics. As I mentioned above, there is a script that rebulds the image from you. Otherwise, it’s not running at all. I think I will add the same permission change to xwiki folder.