Upload attachment function does not work in editing mode
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
問題
- Unable to upload attachments from the Editor either via:
- Edit page > Insert > Attachment
or - Edit page > Insert > Image
or - Edit page > Insert files and images > click on Upload files
- You'll get the following error message:
Could not upload the file to Confluence. The server may be unavailable.
Note that sometimes the attachment will upload despite the warning.
- Edit page > Insert > Attachment
- However, you can successfully upload attachments from:
- Tools > Attachments > Attach File
- Tools > Attachments > Attach File
Diagnosis 1
atlassian-confluence.log
に次のエラーが返される。
012-09-18 19:06:10,170 ERROR [http-8090-4] [atlassian.confluence.servlet.ConfluenceServletDispatcher] serviceAction There is no Action mapped for namespace /confluence/pages and action name attachfile
-- url: /confluence/pages/attachfile.action | userName: florianmayer | referer: http://atlassian.net:8090/pages/createpage.action?spaceKey=ds&fromPageId=121962498
2012-09-18 19:07:19,242 ERROR [http-8090-4] [atlassian.confluence.servlet.ConfluenceServletDispatcher] serviceAction There is no Action mapped for namespace /confluence/pages and action name attachfile
-- url: /confluence/pages/attachfile.action | userName: florianmayer | referer: http://atlassian.net:8090/pages/createpage.action?spaceKey=ds&fromPageId=121962498
2012-09-18 19:09:18,465 ERROR [http-8090-4] [atlassian.confluence.servlet.ConfluenceServletDispatcher] serviceAction There is no Action mapped for namespace /confluence/pages and action name attachfile
-- url: /confluence/pages/attachfile.action | userName: florianmayer | referer: http://atlassian.net:8090/pages/createpage.action?spaceKey=ds&fromPageId=121962498
Diagnosis 2
- Open the Browser Developer tools to the Network tab
- On the Edit screen load, check if there are any HTTP failures on any batch.js calls after the resources call:
- Look for any errors such as HTTP 400, HTTP 0 on the batch.js calls
原因
- The configured base URL does not match the URL you use to access Confluence via the browser. For example, you access Confluence via http://atlassian.net:8090 while the configured base URL from
Confluence Admin > General Configuration
is http://atlassian.net/confluence - There is also a known bug. Follow its progress here: CONF-28564 - Getting issue details... STATUS
- This has also been reported in legacy versions of Confluence (e.g. Confluence 5.6.X) caused by the Brikit Theme Press.
- IIS has a maximum URL length restriction causing long URLs to fail with a HTTP 400
- Antivirus scanners such as Symantec endpoint and/or Trend Micro are running on the Confluence Server
回避策
Enable Safe-Mode and see if the upload functionality works after disabling third party add-ons.
ソリューション 1
Ensure that the configured base URL must match the URL you use to access Confluence via the browser. Update the Base URL from Confluence Admin > General Configuration.
Also check that the <confluence-install-dir>/conf/server.xml
has the relevant proxyName, proxyPort and scheme tags. Refer to the relevant Proxy and HTTPS setup for Confluence guides.
Resolution 2 - IIS
2.1. IIS not using AJP worker
- Open up IIS Manager
- Navigate to the Confluence "site"
- Right click and click Explore
- Edit the web.config file in a text editor
- Make sure in the <system.web> block, there is a value for maxUrlLength="4096", e.g.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> ... </rewrite> <security> ... </security> </system.webServer> <system.web> <!-- This keeps IIS from complaining about special characters in the url. Also has some controls for max upload size. Set to the equivalent of the above, but in kilobytes instead of bytes. (ex. 61440 = 60MB) --> <httpRuntime executionTimeout="20" maxUrlLength="4096" maxRequestLength="100000" requestPathInvalidCharacters="" requestValidationMode="2.0" /> <pages validateRequest="false" /> </system.web> </configuration>
- Make sure in the <system.web> block, there is a value for maxUrlLength="4096", e.g.
- Once the above is done, restart the "IIS service" for the change to take effect
2.2. IIS is using AJP worker
- Open up regedit.exe from Start Menu on the Windows IIS Server
- Reboot the entire Windows machine for the registry change to take effect
ソリューション 3
As per Using Antivirus software with Confluence:
- Disable/Uninstall Symantec Endpoint and/or Trend Micro antivirus scanner from the Confluence Server; or
- Exclude The Tomcat listening port from being scanned; or
- Edit the Trend Micro AV / URI Length and Depth restriction rule to allow long URI length (e.g. set to 1024):