firefly-iii / firefly-iii

Firefly III: a personal finances manager
https://firefly-iii.org/
GNU Affero General Public License v3.0
15.72k stars 1.43k forks source link

Uploading PDF's in transaction not working when over the size limit #960

Closed AndreiGavriliu closed 6 years ago

AndreiGavriliu commented 6 years ago

I am running Firefly III version 4.6.9

Description of my issue:

Uploading PDF's to transactions stopped (?) working. There are no errors. After I select the file to upload, I click "Update withdrawal" and then it redirects to the home page. No errors or anything

Other important details (log files, system info):

Filename: Erwin "Köck Lackerei + Karosserie GmbH (Steinschlag + Tür).pdf"

[2017-10-27 09:38:29] local.DEBUG: Journal collector now collecting for user #1  
[2017-10-27 09:38:29] local.DEBUG: journalCollector::startQuery  
[2017-10-27 09:38:29] local.DEBUG: Set query collector types [["Withdrawal"]] 
[2017-10-27 09:38:29] local.DEBUG: Set limit to 250  
[2017-10-27 09:38:29] local.DEBUG: Page is 0  
[2017-10-27 09:38:29] local.DEBUG: Changed offset to 0  
[2017-10-27 09:38:30] local.DEBUG: Will run 1 filters on the set.  
[2017-10-27 09:38:30] local.DEBUG: Before filter FireflyIII\Helpers\Filter\InternalTransferFilter: 250  
[2017-10-27 09:38:30] local.DEBUG: After filter FireflyIII\Helpers\Filter\InternalTransferFilter: 250  
[2017-10-27 09:38:47] local.DEBUG: Going to store accounts for type Withdrawal  
[2017-10-27 09:38:47] local.DEBUG: Now in storeWithdrawalAccounts().  
[2017-10-27 09:38:47] local.DEBUG: Source account is #1 ("Andrei Gavriliu")  
[2017-10-27 09:38:47] local.DEBUG: destination account name is "Miscellaneous", account is 44  
[2017-10-27 09:38:48] local.DEBUG: Will try to connect tag #170 to journal #1411.  
[2017-10-27 09:38:48] local.INFO: Tag #170 is already connected to journal #1411.  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""what"" with value ""withdrawal"" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""date"" with value "{"date":"2017-09-20 00:00:00.000000","timezone_type":3,"timezone":"UTC"}" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""tags"" with value "["Service"]" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""currency_id"" with value "1" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""notes"" with value ""[REDACTED]"" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""description"" with value ""Erwin K\u00f6ck Lackerei + Karosserie GmbH (Steinschlag + T\u00fcr)"" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""amount"" with value ""650"" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""budget_id"" with value "1" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""category"" with value ""Auto"" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""source_account_id"" with value "1" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""source_account_name"" with value """" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""destination_account_id"" with value """" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""destination_account_name"" with value ""Miscellaneous"" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""piggy_bank_id"" with value "0" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""native_amount"" with value "650" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""source_amount"" with value "650" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""destination_amount"" with value "0" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""foreign_amount"" with value "null" for journal #1411  
[2017-10-27 09:38:48] local.DEBUG: Could not store meta field ""foreign_currency_id"" with value "null" for journal #1411  
[2017-10-27 09:38:50] local.DEBUG: Check if user has already seen intro with key "shown_demo_index". Result is 1  
[2017-10-27 09:38:50] local.DEBUG: Journal collector now collecting for user #1  
[2017-10-27 09:38:50] local.DEBUG: journalCollector::startQuery  
[2017-10-27 09:38:50] local.DEBUG: setAccounts: 1  
[2017-10-27 09:38:50] local.DEBUG: JournalCollector range is now 2017-10-01 - 2017-10-31 (inclusive)  
[2017-10-27 09:38:50] local.DEBUG: Set limit to 10  
[2017-10-27 09:38:50] local.DEBUG: Page is 0  
[2017-10-27 09:38:50] local.DEBUG: Changed offset to 0  
[2017-10-27 09:38:50] local.DEBUG: Will run 1 filters on the set.  
[2017-10-27 09:38:50] local.DEBUG: Before filter FireflyIII\Helpers\Filter\InternalTransferFilter: 10  
[2017-10-27 09:38:50] local.DEBUG: After filter FireflyIII\Helpers\Filter\InternalTransferFilter: 10  
[2017-10-27 09:38:50] local.DEBUG: Journal collector now collecting for user #1  
[2017-10-27 09:38:50] local.DEBUG: journalCollector::startQuery  
[2017-10-27 09:38:50] local.DEBUG: setAccounts: 3  
[2017-10-27 09:38:50] local.DEBUG: JournalCollector range is now 2017-10-01 - 2017-10-31 (inclusive)  
[2017-10-27 09:38:50] local.DEBUG: Set limit to 10  
[2017-10-27 09:38:50] local.DEBUG: Page is 0  
[2017-10-27 09:38:50] local.DEBUG: Changed offset to 0  
[2017-10-27 09:38:50] local.DEBUG: Will run 1 filters on the set.  
[2017-10-27 09:38:50] local.DEBUG: Before filter FireflyIII\Helpers\Filter\InternalTransferFilter: 10  
[2017-10-27 09:38:50] local.DEBUG: After filter FireflyIII\Helpers\Filter\InternalTransferFilter: 10  
[2017-10-27 09:38:50] local.DEBUG: Journal collector now collecting for user #1  
[2017-10-27 09:38:50] local.DEBUG: journalCollector::startQuery  
[2017-10-27 09:38:50] local.DEBUG: setAccounts: 2  
[2017-10-27 09:38:50] local.DEBUG: JournalCollector range is now 2017-10-01 - 2017-10-31 (inclusive)  
[2017-10-27 09:38:50] local.DEBUG: Set limit to 10  
[2017-10-27 09:38:50] local.DEBUG: Page is 0  
[2017-10-27 09:38:50] local.DEBUG: Changed offset to 0  
[2017-10-27 09:38:50] local.DEBUG: Will run 1 filters on the set.  
[2017-10-27 09:38:50] local.DEBUG: Before filter FireflyIII\Helpers\Filter\InternalTransferFilter: 0  
[2017-10-27 09:38:50] local.DEBUG: After filter FireflyIII\Helpers\Filter\InternalTransferFilter: 0  
[2017-10-27 09:38:52] local.DEBUG: viewRange is 1M  
[2017-10-27 09:38:52] local.DEBUG: Custom is true.  
JC5 commented 6 years ago

The file name is something FF3 can handle. Is the file bigger than what it says below the upload box?

AndreiGavriliu commented 6 years ago

File size: 3.32 MB (3,484,007 bytes) Maximum file size: 2 MB

this might be the issue, I'll increase the size on the server. Could you maybe implement a check/validation?

JC5 commented 6 years ago

There is. I shall check what happened. Your browser should have protested as well.

AndreiGavriliu commented 6 years ago

Uploading worked this time:

Possible reasons the validation failed

  1. My browser might be afraid of me, protesting is not allowed :D
  2. I am using Firefox Quantum 57.0b11 (32-bit) - which, I believe, is still beta
  3. In the case there is only a server sided validation - my RPi was too slow to read the file size and send the error to the browser?

In addition, I was redirected to the home page. Would you consider changing this to redirect to transactions/show/<id>? If you edit something and want to see if everything is as it should, you need to go back and search your transaction (if you don't remember the transaction_id)

JC5 commented 6 years ago

It seems Laravel silently drops such uploads. That is new behaviour.

Also, when were you redirected to the home page, exactly?

AndreiGavriliu commented 6 years ago

Sorry, I must have been confused, there's no redirect issue.

Uploading works if the file size is not greater than the allowed upload size in php.ini.

JC5 commented 6 years ago

I'm not sure if I can help it. PHP supports this but the Laravel framework kills these uploads silently. I'll put this down under "enhancement" and find out if I can change this. If not, I'll have to close the issue.

JC5 commented 6 years ago

Unfortunately, Laravel kills the upload. There's not much I can do.