I am new to InvoicePlane. I have downloaded v1.5.3 from the website and followed the installation instructions. The setup wizzard was working great and has done a great job setting everithing up.
Now I have logged in and tried to change some settings - which failed.
I opened the “Settings” -> “System Settings” and tried to change one value (I even tried to change nothing) and clicked “Save”. I got the following error message:
“An Error Was Encountered
The action you have requested is not allowed.”
HTTP return code: 403 Forbidden
I am running Invoice Plain on a server with …
Apache/2.2.15 (Unix)
PHP 5.6.30
I have enabled the following option in the ipconfig.php file:
ENABLE_DEBUG=true
The log file under “application/logs/” shows a few lines when loading the system settings page but only those two lines when trying to save them.
DEBUG - 2017-07-05 10:49:38 --> UTF-8 Support Enabled
DEBUG - 2017-07-05 10:49:38 --> Global POST, GET and COOKIE data sanitized
Do you have to login again after trying to safe the settings?
This is the only clue I have: that somehow your authentication or session data is deleted so you are not allowed to save anything. Because authentication is the only part of the application that actually throws a 403 error.
There must be a way to get more insight into what is going on. I see the whole invoiceplane contails codeigniter and symfony beside others. Dont have those big frameworks some kind of logging which can be enabled???
Do you have access to the apache error log for that vhost?
Because I only see the debug log + access log, the error log of apache could give you more information
I have installed it in a subdirectory which should not be a problem. But the whole webspace is password protected (http auth)
Requests from my browser are no problem as the browser is authenticated. What about invoicePlane internally? Is it trying to perform requests to itself? That could explain 403 errors? … just a wild guess.
I get the same error message and no log message at all. So I was digging into it. Reverted all my settings to plain (insecure) defaults. And it started working.
With it working I tried enabling one setting after the other and was able to identify the root cause of the problem. It was indeed a setting I made. But this setting should have not caused this behaviour.
This is the problem causing htaccess entry:
# Secure: All cookies must be set with the Secure flag, indicating that they should only be sent over HTTPS
Header always edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
That is quite interesting. Will take a look at the IP settings and try to figure out which one causes the problems with the secure cookies. But indeed this should not happen. Thanks for your time to debug this!
I am not exactly new to PHP. Just did not touch any code for a few years. But I am very surprised to see sooo little logging in debug mode. Maybe while fixing it you could add one or two lines telling why the error was returned to the browser? This might help in the future to debug issues in that area.
Another guess, maybe the cookie is missing besause some internally generated link (like the save requests) have hardcoded to http:// ? I will try to verify this … but that might explain the behaviour.