Insufficient permissions to read UCI configuration

Hi, how to edit the uploaded openvpn config file? I'm using OpenWrt 21.02.0-rc4 firmware.

That's a known LuCI bug, see My proposed patch wasn't accepted long time ago ...

If you want to use/test my patched version, just save the code below as map.htm and copy/overwrite it to /usr/lib/lua/luci/view/cbi/map.htm

<%- if firstmap and messages then local msg; for _, msg in ipairs(messages) do -%>
	<div class="alert-message warning"><%=pcdata(msg)%></div>
<%- end end -%>

<% if firstmap and readable then %>
<div class="cbi-map" id="cbi-<%=self.config%>"<%=ifattr(not writable, "style", "opacity:.6; pointer-events:none")%>>
	<% if self.title and #self.title > 0 then %>
		<h2 name="content"><%=self.title%></h2>
	<% end %>
	<% if self.description and #self.description > 0 then %>
		<div class="cbi-map-descr"><%=self.description%></div>
	<% end %>
	<% if self.tabbed then %>
			<% for i, section in ipairs(self.children) do
			       tab = section.section or section.sectiontype %>
				<div class="cbi-tabcontainer"<%=
					attr("id", "container.m-%s.%s" %{ self.config, tab }) ..
					attr("data-tab", tab) ..
					attr("data-tab-title", section.title or tab)
					<% section:render() %>
			<% end %>

		<% if not then -%>
			<div class="cbi-section-error">
				<% for _, section in ipairs(self.children) do %>
					<% if section.error and section.error[section.section] then -%>
							<%:One or more invalid/required values on tab%>:&nbsp;<%=section.title or section.section or section.sectiontype%>
					<%- end %>
				<% end %>
		<%- end %>
	<% else %>
		<%- self:render_children() %>
	<% end %>
<% elseif firstmap then %>
<div class="alert-message warning"><%:Insufficient permissions to read UCI configuration.%></div>
<% end %>

Exactly what I needed, thank you. :slight_smile:

Thank you so much

Got this error message after overwriting the map.htm:

/usr/lib/lua/luci/template.lua:74: Failed to load template 'cbi/map'.
Error while parsing template '/usr/lib/lua/luci/view/cbi/map.htm':
Syntax error in /usr/lib/lua/luci/view/cbi/map.htm:5: unfinished string near '"'
stack traceback:

What version of openwrt are you using?

OpenWrt 21.02.0 r16279-5cc0535800 / LuCI openwrt-21.02 branch git-21.231.26241-422c175

hi, change file format from windows to linux, then it should be ready.
i does the same mistake

Also note that this error seems to be benign - I have no problem actually editing the file, saving it, and restarting OpenVPN with the new configuraiton despite this error.