Bug 642828 - Cannot edit configuration files using the web UI when is bigger then 32KB
Summary: Cannot edit configuration files using the web UI when is bigger then 32KB
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI
Version: 530
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: 462714
TreeView+ depends on / blocked
 
Reported: 2010-10-13 21:47 UTC by Marcelo Moreira de Mello
Modified: 2019-02-15 13:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-04 20:29:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 433378 0 medium CLOSED Configuration Files: "File Is Too Large to Edit" should display MAX_EDITABLE_SIZE instead of CONFIG_REVISION_MAX_SIZE 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 470911 0 medium CLOSED Satellite Documentation: web.maximum_config_file_size and maximum_config_file_size 2021-02-22 00:41:40 UTC

Description Marcelo Moreira de Mello 2010-10-13 21:47:38 UTC
Description of problem:
Cannot edit configuration files using the web UI when is bigger then 32KB but we are able to upload files bigger then 32KB. 

Version-Release number of selected component (if applicable):
Satellite 5.3

How reproducible:
100% 


Steps to Reproduce:

Even changing the configuration, we still just able to edit using the WEB UI files smaller then 32Kb. 

The changes were made in the files below: 

	# /etc/rhn/rhn.conf
	# 2MB
	web.maximum_config_file_size=2097152

	#  Limit the size of POST data (in bytes)
	# 2MB
	web.post_max = 2097152

	# maximum size for a config file
	# 2MB
	web.maximum_config_file_size = 2097152

After restarting the Satellite Server (rhn-satellite restart), the problems remains. 


Actual results:
Cannot edit configuration files using the web UI when file is bigger then 32KB. 

Expected results:
Edit file using web UI when bigger then 32KB.


Additional info:

Looking into the code, we can observe some interesting points below: 


a) FileDetailsAction.java: /code/src/com/redhat/rhn/frontend/action/configuration/files/FileDetailsAction.java

<snip>
public class FileDetailsAction extends RhnAction {
 46 
 47     // REQUEST elements
<snip>
 52     public static final String MAX_SIZE          = "maxbytes";
 53     public static final String MAX_EDIT_SIZE     = "maxEditBytes";
 54     public static final String LAST_USER         = "lastUser";
 55     public static final String LAST_USER_ID      = "lastUserId";
 56     public static final String TOOLARGE          = "toolarge";

<snip>
protected void setupRequestParams(RequestContext ctx, ConfigRevision cr) {
<snip>
112	    request.setAttribute(MAX_SIZE,
113                 StringUtil.displayFileSize(
114                         Config.get().getInt(ConfigDefaults.CONFIG_REVISION_MAX_SIZE,
115                                 ConfigDefaults.DEFAULT_CONFIG_REVISION_MAX_SIZE)));
116         request.setAttribute(MAX_EDIT_SIZE,
117                 StringUtil.displayFileSize(ConfigFileForm.MAX_EDITABLE_SIZE));
                                     ^^^^^^^ ---> here we can see the method requesting an attribute MAX_EDITABLE_SIZE from the class ConfigFileForm. 


b) ConfigFileForm.java: ./code/src/com/redhat/rhn/frontend/action/configuration/ConfigFileForm.java

public class ConfigFileForm extends ScrubbingDynaActionForm {
 51 
 52     /**
 53      * Comment for <code>serialVersionUID</code>
 54      */
 55     private static final long serialVersionUID = -2162768922109257186L;
 56     // configFileForm elements
	<snip>

 81     // Here to deal with form-size-limits
 82     public static final long   MAX_EDITABLE_SIZE = (32L * 1024L);
					^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---> here we can see the attribute MAX_EDITABLE_SIZE being hardcoded set to 32KB :)

Meanwhile, the workaround is download the file locally, edit it, then upload again. That procedure works normally.

Comment 2 Xixi 2011-02-04 20:29:05 UTC
Hi Marcelo, closing this as NOTABUG - see bug 433378 and bug 470911 for background info.  Basically the maximum edit size for configuration files is set to 32 KB due to form size limitations. For anything larger, edit it and upload it (as you noted in Description). Thanks.


Note You need to log in before you can comment on or make changes to this bug.