<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello Fry,<br>
    <br>
    As a extended debug I can suggest following:<br>
    <br>
    1. Could you please apply attached patch.txt:<br>
    <br>
    #create backup<br>
    cp /usr/share/perl5/NGCP/Panel/Controller/Invoice.pm  
    /usr/share/perl5/NGCP/Panel/Controller/Invoice_2015_04_09_00.pm<br>
    <br>
    #apply patch<br>
    patch -p0 < patch.txt<br>
    <br>
    <br>
    2. Enable mysql general log, if it is off now. Kindly look at
    example below:<br>
    <br>
    mysql> show variables like '%general_log%';<br>
    +------------------+-------------------------+<br>
    | Variable_name    | Value                   |<br>
    +------------------+-------------------------+<br>
    | general_log      | OFF                     |<br>
    | general_log_file | /var/lib/mysql/spce.log |<br>
    +------------------+-------------------------+<br>
    2 rows in set (0.00 sec)<br>
    <br>
    mysql> set global general_log='ON';<br>
    Query OK, 0 rows affected (0.00 sec)<br>
    <br>
    mysql> show variables like '%general_log%';<br>
    +------------------+-------------------------+<br>
    | Variable_name    | Value                   |<br>
    +------------------+-------------------------+<br>
    | general_log      | ON                      |<br>
    | general_log_file | /var/lib/mysql/spce.log |<br>
    +------------------+-------------------------+<br>
    2 rows in set (0.00 sec)<br>
    ----------------------------------------------------------<br>
    <br>
    <br>
    After invoice creation failed, you can inspect your mysql general
    log file against query looking  like:<br>
    <br>
    <br>
    <small><small>SELECT `me`.`id`, `me`.`customer_id`,
        `me`.`contact_id`, `me`.`order_id`, `me`.`status`,<br>
         `me`.`external_id`, `me`.`send_invoice`,
        `me`.`modify_timestamp`, `me`.`create_timestamp`,
        `me`.`activate_timestamp`, `<br>
        me`.`terminate_timestamp`, `me`.`max_subscribers`,
        `me`.`subscriber_email_template_id`,
        `me`.`passreset_email_template_i<br>
        d`, `me`.`invoice_email_template_id`,
        `me`.`invoice_template_id`, `me`.`vat_rate`, `me`.`add_vat`,
        `billing_mappings`.`i<br>
        d`, `billing_mappings`.`start_date`,
        `billing_mappings`.`product_id`, `billing_mappings`.`id` FROM
        `billing`.`contracts`<br>
         `me` LEFT JOIN `billing`.`billing_mappings` `billing_mappings`
        ON `billing_mappings`.`contract_id` = `me`.`id` LEFT JOI<br>
        N `billing`.`products` `product` ON `product`.`id` =
        `billing_mappings`.`product_id` LEFT JOIN `billing`.`contacts`
        `con<br>
        tact` ON `contact`.`id` = `me`.`contact_id` WHERE ( ( `me`.`id`
        = '5' AND ( ( `product`.`class` = 'sipaccount' OR `produ<br>
        ct`.`class` = 'pbxaccount' ) AND ( `contact`.`reseller_id` IS
        NOT NULL AND ( `billing_mappings`.`id` = (SELECT `bilmap`.<br>
        `id` FROM `billing`.`billing_mappings` `bilmap` WHERE ( (
        `contract_id` = `me`.`id` AND ( `end_date` >= '2015-04-09
        19:4<br>
        8:09' OR `end_date` IS NULL ) AND ( `start_date` <=
        '2015-04-09 19:48:09' OR `start_date` IS NULL ) ) ) ORDER BY
        `bilmap<br>
        `.`start_date` DESC, `bilmap`.`id` DESC LIMIT 1) AND
        `me`.`status` != 'terminated' ) ) ) ) )<br>
      </small></small><br>
    In place of "5" will be your customer id.<br>
    It is possible that you will not find the query in the log if your
    mysql server gone away due to timeout. <br>
    <br>
    kindly let me know results.<br>
    <br>
    Best regards,<br>
    Irina<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 08.04.2015 Wednesday 19:09, fry
      wrote:<br>
    </div>
    <blockquote cite="mid:552552D3.3010900@friibii.ch" type="cite">
      <pre wrap="">Hi Irina,

thanks for your reply - but i can't understand the whole e-mail.

Yes, the time-out was the problem, but I was able to change the values
for the timeout on nginx and so now i can handle that.. on my lab-server
i saw that he had problems with the amount of pdf-sites (i guess the
command was too large) so i changed the text-size and was able to
generate an invoice with a lot of numbers.. but on the other system i
get this error.

if i generate a invoice (for the same customer) for the actual month
this works fine..

is there any possibility to enable more a deeper log-mode?

thanks
fry

Am 07.04.2015 um 22:01 schrieb Irina Peshinskaya:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hello Fry,

>From your letter from 09.03.2015, I got that by some strange way mysql
timeout was the reason of this error.

Field contract is required and if you don't specify it - you wouldn't
pass form validation and get to this line and thus to this error.
I couldn't request invoice generation on 3.4.2 code with empty
contract (no selected contract).

Is invoice generated OK for the same contract for other periods?

Thanks in advance.

Best regards,
Irina 
</pre>
      </blockquote>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>