Regular Member
Posts: 395
Registered: ‎01-18-2017
Kudos: 125
Solutions: 13

Re: How to force invoice drafts to be sent via email

PM sent

Regular Member
Posts: 395
Registered: ‎01-18-2017
Kudos: 125
Solutions: 13

Re: How to force invoice drafts to be sent via email

I see UBNT released a stable version today. Has this issue been addressed? This is a serious problem.

Ubiquiti Employee
Posts: 1,436
Registered: ‎03-21-2016
Kudos: 234
Solutions: 159

Re: How to force invoice drafts to be sent via email

@clarkraymond As we never managed to reproduce your issue, we're not sure. We did include a possible fix, but as it was working for us without any problems even before that, we don't know if it will help. Please give it a try and let us know.

Regular Member
Posts: 395
Registered: ‎01-18-2017
Kudos: 125
Solutions: 13

Re: How to force invoice drafts to be sent via email

When you duplicated the same steps I took you got different behavior? Did you do so on my backup DB?

Ubiquiti Employee
Posts: 1,436
Registered: ‎03-21-2016
Kudos: 234
Solutions: 159

Re: How to force invoice drafts to be sent via email

@clarkraymond Yes, we did it on your backup, did the same steps and everything worked as it should. From what we could see in the logs, the invoice emails did not get processed in the invoice mailing background queue at all.

So after looking into it, we changed a bit of configuration, that might possibly help with it. But as I said, we were not able to reproduce the problem, so we can't be sure, but please give it a try and let us know if it helped.

Regular Member
Posts: 395
Registered: ‎01-18-2017
Kudos: 125
Solutions: 13

Re: How to force invoice drafts to be sent via email

The system generated an invoice for a new customer last night and sent it ok. Fingers crossed the issue is resolved.

Regular Member
Posts: 395
Registered: ‎01-18-2017
Kudos: 125
Solutions: 13

Re: How to force invoice drafts to be sent via email

[ Edited ]

We generated invoices this morning as expected, got an email telling me recurring invoices were created and send as PDFs to our clients. However, just like last month, none were actually sent. I picked the envelope icon on the invoices page, confirm I want to send them, send them, get a message back telling me they were sent. Not a single one was sent.

 

I have a database backup that was taken 5 hours after the invoices were generated.

 

prod.log

cat prod.log
[2019-03-31 20:10:02] app.INFO: Checking available UCRM versions. [] []
[2019-03-31 20:10:06] app.INFO: Latest version on "stable" channel is "2.15.1". [] []
[2019-03-31 20:10:07] app.ERROR: Server error: `GET https://ucrm.ubnt.com/r/version/beta` resulted in a `502 Bad Gateway` response: <html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> (truncated...) [] []
[2019-04-01 04:10:02] app.INFO: Checking available UCRM versions. [] []
[2019-04-01 04:10:03] app.ERROR: Server error: `GET https://ucrm.ubnt.com/r/version/stable` resulted in a `502 Bad Gateway` response: <html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> (truncated...) [] []
[2019-04-01 04:10:03] app.ERROR: Server error: `GET https://ucrm.ubnt.com/r/version/beta` resulted in a `502 Bad Gateway` response: <html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> (truncated...) [] []
[2019-04-01 06:20:02] app.INFO: Sending statistics. [] []
[2019-04-01 06:20:02] app.ERROR: Server error: `PUT https://ucrm-billing-stats.ubnt.com/api/version` resulted in a `502 Bad Gateway` response: <html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> (truncated...) [] []
[2019-04-01 06:20:02] console.DEBUG: Command "crm:statistics:send --env=prod" exited with code "1" {"command":"crm:statistics:send --env=prod","code":1} []
[2019-04-01 08:10:02] app.INFO: Checking available UCRM versions. [] []
[2019-04-01 08:10:03] app.ERROR: Server error: `GET https://ucrm.ubnt.com/r/version/stable` resulted in a `502 Bad Gateway` response: <html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> (truncated...) [] []
[2019-04-01 08:10:03] app.ERROR: Server error: `GET https://ucrm.ubnt.com/r/version/beta` resulted in a `502 Bad Gateway` response: <html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> (truncated...) [] []

 

Ubiquiti Employee
Posts: 4,034
Registered: ‎12-10-2015
Kudos: 1424
Solutions: 312

Re: How to force invoice drafts to be sent via email

@clarkraymond we will investigate this. Can you let us know whether the emails were created so the sending failed or whether they weren't created at all? Check the System > Logs > Email logs or check the log of some client's profile.
Regular Member
Posts: 395
Registered: ‎01-18-2017
Kudos: 125
Solutions: 13

Re: How to force invoice drafts to be sent via email

Thanks, it appears NO emails were generated until I manually sent each invoice one by one. UCRM would not send them all with one click...

Ubiquiti Employee
Posts: 1,436
Registered: ‎03-21-2016
Kudos: 234
Solutions: 159

Re: How to force invoice drafts to be sent via email

@clarkraymond Sorry to hear that, can you please send us the container log? You can get it as follows:

sudo docker logs ucrm_web_app_1 > log.txt

A file called log.txt will be created with the log. Feel free to PM me if you don't want to post publicly.

Regular Member
Posts: 395
Registered: ‎01-18-2017
Kudos: 125
Solutions: 13

Re: How to force invoice drafts to be sent via email

Here you go:

2019-03-24 00:42:02,170 INFO waiting for nginx to stop
2019-03-24 00:42:02,201 INFO stopped: nginx (exit status 0)
2019-03-24 00:42:02,220 INFO spawned: 'nginx' with pid 46513
2019-03-24 00:42:02,224 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-24 06:42:02,332 INFO waiting for nginx to stop
2019-03-24 06:42:02,365 INFO stopped: nginx (exit status 0)
2019-03-24 06:42:02,373 INFO spawned: 'nginx' with pid 76342
2019-03-24 06:42:02,373 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-24 12:42:01,561 INFO waiting for nginx to stop
2019-03-24 12:42:01,596 INFO stopped: nginx (exit status 0)
2019-03-24 12:42:01,610 INFO spawned: 'nginx' with pid 106240
2019-03-24 12:42:01,611 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-24 18:42:01,727 INFO waiting for nginx to stop
2019-03-24 18:42:01,754 INFO stopped: nginx (exit status 0)
2019-03-24 18:42:01,764 INFO spawned: 'nginx' with pid 6982
2019-03-24 18:42:01,766 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-25 00:42:01,801 INFO waiting for nginx to stop
2019-03-25 00:42:01,823 INFO stopped: nginx (exit status 0)
2019-03-25 00:42:01,836 INFO spawned: 'nginx' with pid 36892
2019-03-25 00:42:01,840 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-25 06:42:01,692 INFO waiting for nginx to stop
2019-03-25 06:42:01,730 INFO stopped: nginx (exit status 0)
2019-03-25 06:42:01,744 INFO spawned: 'nginx' with pid 66732
2019-03-25 06:42:01,748 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-25 12:42:01,776 INFO waiting for nginx to stop
2019-03-25 12:42:01,800 INFO stopped: nginx (exit status 0)
2019-03-25 12:42:01,809 INFO spawned: 'nginx' with pid 96607
2019-03-25 12:42:01,816 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-25 18:42:01,793 INFO waiting for nginx to stop
2019-03-25 18:42:01,818 INFO stopped: nginx (exit status 0)
2019-03-25 18:42:01,831 INFO spawned: 'nginx' with pid 128099
2019-03-25 18:42:01,832 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-26 00:42:02,018 INFO waiting for nginx to stop
2019-03-26 00:42:02,059 INFO stopped: nginx (exit status 0)
2019-03-26 00:42:02,079 INFO spawned: 'nginx' with pid 27259
2019-03-26 00:42:02,090 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-26 06:42:01,799 INFO waiting for nginx to stop
2019-03-26 06:42:01,841 INFO stopped: nginx (exit status 0)
2019-03-26 06:42:01,874 INFO spawned: 'nginx' with pid 57094
2019-03-26 06:42:01,874 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-26 12:42:02,192 INFO waiting for nginx to stop
2019-03-26 12:42:02,217 INFO stopped: nginx (exit status 0)
2019-03-26 12:42:02,233 INFO spawned: 'nginx' with pid 86968
2019-03-26 12:42:02,233 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-26 18:42:01,796 INFO waiting for nginx to stop
2019-03-26 18:42:01,817 INFO stopped: nginx (exit status 0)
2019-03-26 18:42:01,824 INFO spawned: 'nginx' with pid 118453
2019-03-26 18:42:01,825 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-27 00:42:02,112 INFO waiting for nginx to stop
2019-03-27 00:42:02,180 INFO stopped: nginx (exit status 0)
2019-03-27 00:42:02,187 INFO spawned: 'nginx' with pid 17623
2019-03-27 00:42:02,188 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-27 06:42:02,237 INFO waiting for nginx to stop
2019-03-27 06:42:02,277 INFO stopped: nginx (exit status 0)
2019-03-27 06:42:02,291 INFO spawned: 'nginx' with pid 47453
2019-03-27 06:42:02,291 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-27 12:42:01,658 INFO waiting for nginx to stop
2019-03-27 12:42:01,698 INFO stopped: nginx (exit status 0)
2019-03-27 12:42:01,705 INFO spawned: 'nginx' with pid 77334
2019-03-27 12:42:01,705 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-27 18:42:01,417 INFO waiting for nginx to stop
2019-03-27 18:42:01,453 INFO stopped: nginx (exit status 0)
2019-03-27 18:42:01,466 INFO spawned: 'nginx' with pid 108810
2019-03-27 18:42:01,467 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-28 00:42:02,098 INFO waiting for nginx to stop
2019-03-28 00:42:02,121 INFO stopped: nginx (exit status 0)
2019-03-28 00:42:02,131 INFO spawned: 'nginx' with pid 7980
2019-03-28 00:42:02,135 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-28 06:42:02,259 INFO waiting for nginx to stop
2019-03-28 06:42:02,290 INFO stopped: nginx (exit status 0)
2019-03-28 06:42:02,298 INFO spawned: 'nginx' with pid 37817
2019-03-28 06:42:02,298 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-28 12:42:02,104 INFO waiting for nginx to stop
2019-03-28 12:42:02,143 INFO stopped: nginx (exit status 0)
2019-03-28 12:42:02,150 INFO spawned: 'nginx' with pid 67704
2019-03-28 12:42:02,150 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-28 18:42:01,910 INFO waiting for nginx to stop
2019-03-28 18:42:01,949 INFO stopped: nginx (exit status 0)
2019-03-28 18:42:01,956 INFO spawned: 'nginx' with pid 99185
2019-03-28 18:42:01,957 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-29 00:42:02,275 INFO waiting for nginx to stop
2019-03-29 00:42:02,309 INFO stopped: nginx (exit status 0)
2019-03-29 00:42:02,317 INFO spawned: 'nginx' with pid 129099
2019-03-29 00:42:02,317 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-29 06:42:02,053 INFO waiting for nginx to stop
2019-03-29 06:42:02,096 INFO stopped: nginx (exit status 0)
2019-03-29 06:42:02,113 INFO spawned: 'nginx' with pid 28208
2019-03-29 06:42:02,113 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-29 12:42:01,869 INFO waiting for nginx to stop
2019-03-29 12:42:01,898 INFO stopped: nginx (exit status 0)
2019-03-29 12:42:01,906 INFO spawned: 'nginx' with pid 58081
2019-03-29 12:42:01,906 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-29 18:42:01,400 INFO waiting for nginx to stop
2019-03-29 18:42:01,434 INFO stopped: nginx (exit status 0)
2019-03-29 18:42:01,442 INFO spawned: 'nginx' with pid 89609
2019-03-29 18:42:01,447 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-30 00:42:01,856 INFO waiting for nginx to stop
2019-03-30 00:42:01,895 INFO stopped: nginx (exit status 0)
2019-03-30 00:42:01,912 INFO spawned: 'nginx' with pid 119517
2019-03-30 00:42:01,915 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-30 06:42:02,042 INFO waiting for nginx to stop
2019-03-30 06:42:02,077 INFO stopped: nginx (exit status 0)
2019-03-30 06:42:02,086 INFO spawned: 'nginx' with pid 18611
2019-03-30 06:42:02,090 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-30 12:42:01,562 INFO waiting for nginx to stop
2019-03-30 12:42:01,594 INFO stopped: nginx (exit status 0)
2019-03-30 12:42:01,608 INFO spawned: 'nginx' with pid 48485
2019-03-30 12:42:01,608 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-30 18:42:03,056 INFO waiting for nginx to stop
2019-03-30 18:42:03,092 INFO stopped: nginx (exit status 0)
2019-03-30 18:42:03,106 INFO spawned: 'nginx' with pid 79955
2019-03-30 18:42:03,113 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-31 00:42:02,162 INFO waiting for nginx to stop
2019-03-31 00:42:02,193 INFO stopped: nginx (exit status 0)
2019-03-31 00:42:02,200 INFO spawned: 'nginx' with pid 109864
2019-03-31 00:42:02,201 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-31 06:42:01,297 INFO waiting for nginx to stop
2019-03-31 06:42:01,332 INFO stopped: nginx (exit status 0)
2019-03-31 06:42:01,339 INFO spawned: 'nginx' with pid 8950
2019-03-31 06:42:01,340 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-31 12:42:01,703 INFO waiting for nginx to stop
2019-03-31 12:42:01,733 INFO stopped: nginx (exit status 0)
2019-03-31 12:42:01,740 INFO spawned: 'nginx' with pid 38826
2019-03-31 12:42:01,741 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-03-31 18:42:01,943 INFO waiting for nginx to stop
2019-03-31 18:42:01,990 INFO stopped: nginx (exit status 0)
2019-03-31 18:42:02,010 INFO spawned: 'nginx' with pid 70295
2019-03-31 18:42:02,017 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-04-01 00:42:01,656 INFO waiting for nginx to stop
2019-04-01 00:42:01,691 INFO stopped: nginx (exit status 0)
2019-04-01 00:42:01,704 INFO spawned: 'nginx' with pid 100202
2019-04-01 00:42:01,707 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-04-01 06:42:01,834 INFO waiting for nginx to stop
2019-04-01 06:42:01,869 INFO stopped: nginx (exit status 0)
2019-04-01 06:42:01,876 INFO spawned: 'nginx' with pid 130039
2019-04-01 06:42:01,876 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-04-01 12:42:02,126 INFO waiting for nginx to stop
2019-04-01 12:42:02,165 INFO stopped: nginx (exit status 0)
2019-04-01 12:42:02,175 INFO spawned: 'nginx' with pid 29187
2019-04-01 12:42:02,180 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-04-01 18:42:01,782 INFO waiting for nginx to stop
2019-04-01 18:42:01,820 INFO stopped: nginx (exit status 0)
2019-04-01 18:42:01,831 INFO spawned: 'nginx' with pid 60816
2019-04-01 18:42:01,834 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-04-02 00:42:01,632 INFO waiting for nginx to stop
2019-04-02 00:42:01,669 INFO stopped: nginx (exit status 0)
2019-04-02 00:42:01,690 INFO spawned: 'nginx' with pid 90857
2019-04-02 00:42:01,690 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-04-02 06:42:02,057 INFO waiting for nginx to stop
2019-04-02 06:42:02,093 INFO stopped: nginx (exit status 0)
2019-04-02 06:42:02,100 INFO spawned: 'nginx' with pid 120697
2019-04-02 06:42:02,101 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-04-02 12:42:01,477 INFO waiting for nginx to stop
2019-04-02 12:42:01,513 INFO stopped: nginx (exit status 0)
2019-04-02 12:42:01,525 INFO spawned: 'nginx' with pid 19827
2019-04-02 12:42:01,528 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)

Regular Member
Posts: 395
Registered: ‎01-18-2017
Kudos: 125
Solutions: 13

Re: How to force invoice drafts to be sent via email

Also I offer a clarification.

 

The email titled "Recurring invoices have been created" was generated and successfully sent. It said UCRM had just created our recurring invoices and they were send as PDF to our clients. They were not actually sent.

Highlighted
Ubiquiti Employee
Posts: 1,436
Registered: ‎03-21-2016
Kudos: 234
Solutions: 159

Re: How to force invoice drafts to be sent via email

Hello @clarkraymond, please do the following to debug the process:

 

1) stop the "send_invoice" queue consumer (we will later run it manually):

sudo docker exec -it ucrm_web_app_1 bash -c 'supervisorctl stop send_invoice'

2) create debug config to allow for extremely verbose logging (production config will still be in use by everything else, we'll specify the usage of this config just for the later command):

sudo docker exec -it ucrm_web_app_1 bash -c 'su-exec nginx cp /usr/src/ucrm/app/config/config_prod.yml /usr/src/ucrm/app/config/config_debug.yml'

3) start the "send_invoice" queue manually using debug config - we will need output logs from this:

sudo docker exec -it ucrm_web_app_1 su-exec nginx /usr/src/ucrm/app/console rabbitmq:consumer send_invoice -vvv --env=debug

4) Keep this running, all output related to invoice sending will be visible here. Then go to UCRM and either generate recurring invoices or try to send the multiple invoices via dialog that was not working for you.

 

5) Stop the command executed at #3 and grab the logs it outputted.

 

6) Start the regular "send_invoice" queue consumer again:

sudo docker exec -it ucrm_web_app_1 bash -c 'supervisorctl start send_invoice'