Git Product home page Git Product logo

Comments (11)

WesleyCharlesBlake avatar WesleyCharlesBlake commented on September 26, 2024 1

ok so setting the environment vars through the docker-compose.yml file works:

eg

    environment:
      APP_DEBUG: 1
      DB_USERNAME: dbusername
      DB_PASSWORD: dbpassword
      MAIL_DRIVER: mailgun
      MAIL_USERNAME: [email protected]
      MAIL_FROM_ADDRESS: [email protected]
      MAIL_FROM_NAME: 'Strato Technology'
      MAILGUN_DOMAIN: mg.mydomain.com
      MAILGUN_SECRET: key-mysecretkey

from dockerfiles.

lalop avatar lalop commented on September 26, 2024 1

this is a good news, I have to update the doc and the example

from dockerfiles.

WesleyCharlesBlake avatar WesleyCharlesBlake commented on September 26, 2024

Running the commands manually in the container work as well:

www-data@8d4e982a6ad5:~/app$ DB_USERNAME=root DB_PASSWORD=pwd /usr/local/bin/php /var/www/app/artisan ninja:send-reminders
2017-01-20 Running SendReminders...
1 accounts found
Strato Technology | DevOps as a Service: 0 invoices found
Done
www-data@8d4e982a6ad5:~/app$ DB_USERNAME=root DB_PASSWORD=pwd /usr/local/bin/php /var/www/app/artisan ninja:send-invoices
2017-01-20 Running SendRecurringInvoices...
2 recurring invoice(s) found
Processing Invoice 2 - Should send NO
Processing Invoice 3 - Should send NO
0 due recurring invoice instance(s) found
Done

from dockerfiles.

WesleyCharlesBlake avatar WesleyCharlesBlake commented on September 26, 2024

The logs indicate the following only

[2017-01-09 13:06:12] production.ERROR: Cache for currencies is not set  {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"http://localhost","user_agent":"","ip":"127.0.0.1","count":1} []
[2017-01-09 13:06:12] production.ERROR: ErrorException: Trying to get property of non-object in /var/www/app/app/Libraries/Utils.php:393 Stack trace: #0 /var/www/app/app/Libraries/Utils.php(393): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/var/www/app/ap...', 393, Array) #1 /var/www/app/app/Models/Account.php(488): App\Libraries\Utils::formatMoney(225, 4, false, 'symbol') #2 /var/www/app/app/Services/TemplateService.php(51): App\Models\Account->formatMoney('225.00', Object(App\Models\Client)) #3 /var/www/app/app/Ninja/Mailers/ContactMailer.php(191): App\Services\TemplateService->processVariables('<div>$client,</...', Array) #4 /var/www/app/app/Ninja/Mailers/ContactMailer.php(110): App\Ninja\Mailers\ContactMailer->sendInvitation(Object(App\Models\Invitation), Object(App\Models\Invoice), '<div>$client,</...', 'Reminder: Invoi...', false, Array) #5 /var/www/app/app/Console/Commands/SendReminders.php(74): App\Ninja\Mailers\ContactMailer->sendInvoice(Object(App\Models\Invoice), 'reminder2') #6 [internal function]: App\Console\Commands\SendReminders->fire() #7 /var/www/app/bootstrap/cache/compiled.php(1257): call_user_func_array(Array, Array) #8 /var/www/app/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array) #9 /var/www/app/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #10 /var/www/app/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #11 /var/www/app/vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #12 /var/www/app/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\SendReminders), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #13 /var/www/app/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #14 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #15 /var/www/app/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #16 {main} [] []

It could be that the cache is not being created? Im not sure, I will see what I can find out

from dockerfiles.

cinemast avatar cinemast commented on September 26, 2024

I am having the same issue.

from dockerfiles.

dlichtenegger avatar dlichtenegger commented on September 26, 2024

I'm having the same issue too.

from dockerfiles.

lalop avatar lalop commented on September 26, 2024

I think the issue comme from the .env is not shared, can you try by adding email setting in your docker compose env https://github.com/invoiceninja/invoiceninja/blob/master/.env.example ?

from dockerfiles.

WesleyCharlesBlake avatar WesleyCharlesBlake commented on September 26, 2024

I was just about say :).

The cron container doesnt have the .env file

Cron container:

www-data@ccef0ffe4b60:~/app$ ls -al | grep env
-rw-rw-r--  1 www-data www-data   1934 Jan 30 12:40 .env.example

The App container:

root@39fca6164cb5:/var/www/app# ls -al | grep env
-rw-r--r--  1 www-data www-data   4020 Feb  3 13:37 .env
-rw-rw-r--  1 www-data www-data   1934 Jan 30 12:40 .env.example

Inside the .env file on the app container, I can see my mailgun settings:

root@39fca6164cb5:/var/www/app# cat .env | grep MAILGUN
MAILGUN_DOMAIN=mg.mydomain.com
MAILGUN_SECRET=key-somesecretapikeyhere

I will update my PR to resolve this

from dockerfiles.

lalop avatar lalop commented on September 26, 2024

Can you just give a try to set this env variable via the docker env mecanism ?

from dockerfiles.

lalop avatar lalop commented on September 26, 2024

here it's 771f647

from dockerfiles.

MegaphoneJon avatar MegaphoneJon commented on September 26, 2024

For others who are receiving this same error: Another potential cause is that you haven't set up your volumes, or you haven't shared your invoiceninja container's volumes with your invoiceninja-cron container.

from dockerfiles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.