Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recurring transactions are not being created #1583

Closed
skuzzle opened this issue Aug 1, 2018 · 33 comments
Closed

Recurring transactions are not being created #1583

skuzzle opened this issue Aug 1, 2018 · 33 comments

Comments

@skuzzle
Copy link
Contributor

skuzzle commented Aug 1, 2018

Hi,

I'm still running 4.7.5 on a Windows Server.
As mentioned before, I have set up the Windows Task Scheduler to perform the php artisan schedule:run command every minute (is it really necessary to call the command every minute?)
Now it seems that firefly still does not create any recurring transactions. I added multiple RTs for the 1st of the month on 2 firefly user accounts but none has been created.

When running the command manually I get the output

No scheduled commands are ready to run.

When running from task scheduler I can't see the output but I can see that the commands exits with code 0

There is also no hint in the log files (I've configured level 'warning' for logging).

@JC5
Copy link
Member

JC5 commented Aug 1, 2018

Yeah I was afraid this might happen.

So Laravel only supports cron jobs which need to fire every minute. It's literally the least useful way of doing cron jobs. Even IFTTT calling special URL's would be more useful.

What I am going to do for the next release is see if I can add as many "pseudo cron jobs" as possible. I know that Firefly III can handle it if you call the recurring transaction routine twice in one day. It will not break or do things double.

What I would like to introduce is a useful way of doing cron jobs (besides what Laravel offers):

  • A daily cron job in the form of an artisan command (like php artisan firefly:cron).
  • A daily cron job in the form of a special URL (like /cron?access_token=x)

That would be a lot more useful than what there is now. In fact, that last one could be called daily by IFTTT if you have an account there.

It's just that I focused on the feature itself, and not yet on the cron job. So stay tuned!

@skuzzle
Copy link
Contributor Author

skuzzle commented Aug 1, 2018

So long story short I can not yet reliably use recurring transactions? That's sad because I was really looking forward to that feature. But I guess it won't kill me to create some transactions manually like I always did until there is a solid solution.

@JC5
Copy link
Member

JC5 commented Aug 1, 2018

There is no reason why it should not work on Windows. I can Google several solutions to get a cron job going on windows that people say will work.

It will take at least 24hrs to get it going, this is something with Laravel counting to the next time it should run. Until Laravel feels its time for the job nothing will happen. I believe this is 02:00am.

I'm just saying I will add even easier methods 😉

@JC5 JC5 added the enhancement Requests for enhancements of existing stuff. label Aug 1, 2018
@skuzzle
Copy link
Contributor Author

skuzzle commented Aug 1, 2018

I have already successfully setup the command to run every minute. It hasn't created any transactions though. I'll wait until tomorrow to check whether Laravell is just 24hours off its schedule :D

@JC5 JC5 removed the enhancement Requests for enhancements of existing stuff. label Sep 5, 2018
@JC5
Copy link
Member

JC5 commented Sep 5, 2018

In the new version you should be able to set the daily firefly:cron command to make the cron work. That should be a lot easier than a cron job every minute.

@skuzzle
Copy link
Contributor Author

skuzzle commented Sep 5, 2018

I've seen it already. I guess l'll upgrade this weekend and the check whether it works. Thanks a lot for the improvement

@skuzzle
Copy link
Contributor Author

skuzzle commented Sep 6, 2018

Hi,

I made the upgrade yesterday. Through a misconfigured recurring transaction (set to daily instead of monthly) I already found out that it's working now :D

@skuzzle skuzzle closed this as completed Sep 6, 2018
@TobiasDev
Copy link

Sorry, I just need to ask. I'm trying to follow the https://firefly-iii.readthedocs.io/en/latest/installation/cronjob.html using IFTTT, however, when I do the call to the address in in it https://mydomainname.com/cron/run/profileidthing it never works. It keeps failing, and when I look into my folders I can't see a folder called cron, or run, have I done the link wrong?

@JC5
Copy link
Member

JC5 commented Oct 4, 2018

https://demo.firefly-iii.org/cron/run/57eb79c7989ed0d53f3efc1535b8c9b8

It should say "fired successfully" or "The recurring transaction cron job did not fire.".

Does it say either of these things or do you get another error?

Oh, and the URL is a fake URL but it should work just the same.

@TobiasDev
Copy link

Yeah, I was more wondering if it should be https://mydomain.org/57eb79c7989ed0d53f3efc1535b8c9b8
or https://mydomain.org/cron/run/57eb79c7989ed0d53f3efc1535b8c9b8

I get two different errors: "Unable to make web request. Your server returned a 404" So I wonder if my link is wrong towards the path of the cron. Or maybe it is something when you isntall through Softaculos again? Like it was with my other issue.

@JC5
Copy link
Member

JC5 commented Oct 4, 2018

What is the URL of the login page? Could you share everything after the .de or the .com or what your domain is?

@TobiasDev
Copy link

Yeah, for sure. the full address to my login is: https://fin.postnow.eu/public, in my IFTTT I'm using this address: http://fin.postnow.eu/public/cron/run/code

@TobiasDev
Copy link

I also tried having http://fin.postnow.eu/cron/run/code

@TobiasDev
Copy link

Should I give you my code so you can test? And then just generate a new one?

@JC5
Copy link
Member

JC5 commented Oct 4, 2018

This should be the URL: https://fin.postnow.eu/public/cron/run/code

What happens when you go there in the browser?

@TobiasDev
Copy link

"
Whoops! An error occurred.

Unfortunately, this error was not recoverable. Firefly III broke. The error is:

Trying to get property 'data' of non-object
"

@JC5
Copy link
Member

JC5 commented Oct 4, 2018

I saw it. Can you check on your server, the content of the /storage/logs directory?

@TobiasDev
Copy link

Yeah, I have several files, two from today (or three), anything special I should look for, or should I just post the whole thing here?

@JC5
Copy link
Member

JC5 commented Oct 4, 2018

If you follow the instructions to enable debug mode and then only visit the page with /cron/run the log that will be created can tell me exactly what is going on. Just send it to me over email, because it could contain private data.

I think it's a bug but I want to be sure.

@TobiasDev
Copy link

Ah, okay! Will do.

@TobiasDev
Copy link

Sent! :) thanks for helping me look into it.

JC5 added a commit that referenced this issue Oct 4, 2018
@JC5
Copy link
Member

JC5 commented Oct 4, 2018

It seems to be a bug. Do you have multiple users in your installation of Firefly III?

I've pushed a fix for the next release. You can check it out in the commit above my reply on GitHub. If you want to, you can replace the line yourself and it should work for you as well.

@TobiasDev
Copy link

We, or well, I have set-up a few accounts for some friends, so we are sharing the costs and such, since we all liked the idea of the app! :) I hope that is fine! And once again, thank you!

@JC5
Copy link
Member

JC5 commented Oct 4, 2018

Of course, that's perfectly fine. That was the idea of making it "multi-user". I just had to make sure that you knew about it.

You can also fix this issue by making everybody login and visit their /profile page.

@TobiasDev
Copy link

Ah, well, I updated the line and will test if it works now! :)

@TobiasDev
Copy link

Sorry... Seems like I got a new issue now. :(

"Argument 2 passed to FireflyIII\Factory\TransactionFactory::findAccount() must be of the type integer or null, string given, called in /home/postagzd/fin.postnow.eu/app/Factory/TransactionFactory.php on line 123"

Do you want me to get a full debug again?

@JC5
Copy link
Member

JC5 commented Oct 4, 2018

Yes please. I need to know which code is the bad code.

@TobiasDev
Copy link

Sent! Sorry for the trouble.

JC5 added a commit that referenced this issue Oct 4, 2018
@JC5
Copy link
Member

JC5 commented Oct 4, 2018

No problem, just pushed another fix.

@TobiasDev
Copy link

Wow, that speed. Testing now.

@TobiasDev
Copy link

That seems to have fixed it! My applet run (I couldn't get my cronjob to work no matter what I did, so decided to try the IFTTT suggestion you have in the docs). And now the applet ran, and I no longer have the blue box saying cron-job hasn't ever run over my re-curring. So now I will test adding one for tomorrow and se if that get's added! Thanks a lot for the help!

@JC5
Copy link
Member

JC5 commented Oct 5, 2018

No problem 👍 @skuzzle sorry for spamming your mailbox 😉

@skuzzle
Copy link
Contributor Author

skuzzle commented Oct 5, 2018

No problem. I'm, watching every issue anyways :)

@lock lock bot locked as resolved and limited conversation to collaborators Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants