cachethq / cachet

🚦 The open-source status page system.
https://cachethq.io
MIT License
14.07k stars 1.56k forks source link

2.4: Maintenance doesn't works #3626

Closed anthosz closed 1 year ago

anthosz commented 5 years ago

Hello,

In 2.4 (last commit as this day), maintenance seems doesn't works.

I try to insert a maintenance event between 28 & 31 May 2019 with differents status and no maintenance are showed on status page.

mysql> select * from schedules; | id | name | message | status | scheduled_at | completed_at | created_at | updated_at | deleted_at | | 1 | test | test | 0 | 2019-05-28 11:56:00 | 2019-05-31 21:30:00 | 2019-05-29 09:22:32 | 2019-05-29 09:56:51 | NULL

Best regards,

pehlert commented 5 years ago

Not sure if it helps, but I can confirm this on a fresh installation

ArthurKnoep commented 5 years ago

Same problem here, also when I create the maintenance from the dashboard, it end on a 500 error

ArthurKnoep commented 5 years ago

Why have you closed the issue, have you fixed your instance ?

anthosz commented 5 years ago

@arthurknoep, oups bad manipulation on my smartphone, now open ^^ thx for notification

lunarthegrey commented 5 years ago

Same issue, can't create any maintenance.

jbrooksuk commented 5 years ago

I'm going to investigate this now.

jbrooksuk commented 5 years ago

This is weird, I've just created maintenance without issue:

image

Can someone please try this again and then provide me with your error logs?

lunarthegrey commented 5 years ago

@jbrooksuk when trying to create a maintenance I get this 500 error page Screenshot_2019-06-23 Error 500

When I run docker-compose logs all I see is the GET and POST requests.

cachet_1    | 172.24.0.1 - - [23/Jun/2019:20:09:04 +0000] "GET /dashboard/schedule/create HTTP/1.0" 200 9810 "https://status.domain.com/dashboard/schedule" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" "xx.xx.xx.xx"
cachet_1    | 172.24.0.1 - - [23/Jun/2019:20:09:19 +0000] "POST /dashboard/schedule/create HTTP/1.0" 500 3169 "https://status.domain.com/dashboard/schedule/create" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" "xx.xx.xx.xx"
cachet_1    | 172.24.0.1 - - [23/Jun/2019:20:09:19 +0000] "GET /favicon.ico HTTP/1.0" 200 1034 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" "xx.xx.xx.xx"
anthosz commented 5 years ago

@jbrooksuk I just checkout the code on the last revision (2.4) (cache/config/route cleaned) and I have the same issue: Successfully created: image

But nothing appear on status page.

Moreover, I didn't have any errors in apache or php/laravel logs (with PHP 7.2) :(

InsaneSplash commented 5 years ago

We have the same problem and I'm running the latest 2.4.0-dev revision as of this post. We have had to resort to using Stickied Incidents.

pridit commented 5 years ago

This is working for me on a new installation, if anyone incorrectly read (as I sadly did) When did this maintenance complete? as a window for said maintenance this is not how it functions. Setting this to anything will hide the maintenance.

anthosz commented 5 years ago

@pridit Indeed, I confirm, thx! I f I remove "maintenance complete", it works but it's confusing ^^

InsaneSplash commented 5 years ago

I tried removing the completed date/time but on each save it puts it back. I would think that the completed field should really be the end time of the maintenance. Ie, after this time the maintenance will be removed.

I edited the database manually to remove the completed_at time, but noticed that on other schedules that I did not view or edit, the scheduled_at time had all changed to now().

lunarthegrey commented 5 years ago

If I leave the When did this maintenance complete? blank and just put in the time for When is this maintenance scheduled for? it still gives me a 500 error.

duysmil commented 5 years ago

Maintenance not work for me in 2.4

I edit page code, and see missing

div class="section-scheduled"

in home page

This page have this section

https://status.framasoft.org/

Pimorez commented 5 years ago

Maintenance not work for me in 2.4

I edit page code, and see missing

div class="section-scheduled"

in home page

This page have this section

https://status.framasoft.org/

I see that it is currently working for you. May I ask what it was that fixed it? I already tried removing the When did this maintenance complete? date but no success there.

duysmil commented 5 years ago

Hello,

framasoft is not my page, I found the internet to show by example.

in my installation 2.4 does not work.

I sent an email to framasoft asking the version, reported that they use version 2.3.10

I tried anyway to install 2.3.10 and I could not.

Does anyone have the tutorial on how to install 2.3.10?

thanks

duysmil commented 5 years ago

This is weird, I've just created maintenance without issue:

image

Can someone please try this again and then provide me with your error logs?

After some tests I noticed that the timezone when creating the maintenance event is being inserted incorrectly in the database.

in the example below I created the schedule at 12 o'clock to run between 12 and 13 o'clock on 07/13/2019 and it was recorded on the bench as below.

Timezone in Cachet is -3, but I verify that the event only appears after a few hours.

7 Maint Maint TEST 0 2019-07-13 15:00:00 2019-07-13 16:00:00 2019-07-12 14:50:57 2019-07-12 14:50:57

Could it be just my confusion or is it some error in the system?

MichaelOrtnerINFO commented 5 years ago

Hello same problem, is there a update for this problem?

mbrother2 commented 5 years ago

Hi all,

I found the problem! Please do not set time at "When did this maintenance complete?" Your maintenance event will be shown on status page.

MichaelOrtnerINFO commented 5 years ago

No, thats not the problem. I have test it and this does not help.

Pimorez commented 5 years ago

That did not solve it for me last time, but somehow it does work right now when I create a maintenance, set it to 'upcoming' and it not having an end date.

Do note that editing a maintenance by removing the end date does not work, but creating a new maintenance and not filling in the end date does make the maintenance appear on the homepage.

duysmil commented 5 years ago

Hi all,

I found the problem! Please do not set time at "When did this maintenance complete?" Your maintenance event will be shown on status page.

This Work for me... Thanks.

The Email to subscribers users when schendule mainteinance still does not work :-(

Pimorez commented 5 years ago

Hi all, I found the problem! Please do not set time at "When did this maintenance complete?" Your maintenance event will be shown on status page.

This Work for me... Thanks.

The Email to subscribers users when schendule mainteinance still does not work :-(

That is being worked on in #3687

mbrother2 commented 5 years ago

@Pimorez @MichaelOrtnerINFO The mainteinance must satisfy the following two conditions:

MichaelOrtnerINFO commented 5 years ago

@mbrother2 we have just test this, if we create a maintenance at 12:00 clock then the item is hidden on the status page on the admin panel i can see it, but it will be not show on the status page. the problem is still there

Korthoutrody commented 5 years ago

Fixable as follows. In Models - Schedule.php - remove the following line. Now it will still show completed maintenance. However, it will now never be removed. If someone wants to make a proper replacement to this line, so it shows future completed maintenance but not already completed maintenance.

    public function scopeUncompleted(Builder $query)
    {
        return $query->whereIn('status', [self::UPCOMING, self::IN_PROGRESS])->where(function (Builder $query) {
            //return $query->whereNull('completed_at');  <<-- REMOVE THIS LINE.
        });
    }
duysmil commented 5 years ago

Fixable as follows. In Models - Schedule.php - remove the following line. Now it will still show completed maintenance. However, it will now never be removed. If someone wants to make a proper replacement to this line, so it shows future completed maintenance but not already completed maintenance.

    public function scopeUncompleted(Builder $query)
    {
        return $query->whereIn('status', [self::UPCOMING, self::IN_PROGRESS])->where(function (Builder $query) {
            //return $query->whereNull('completed_at');  <<-- REMOVE THIS LINE.
        });
    }

thanks

MichaelOrtnerINFO commented 5 years ago

thank you very much! That has resolved the problem!

MichaelOrtnerINFO commented 5 years ago

so now i must ask the next question, is there a workaround, if the maintenance arrived at the date, where it should be to make automatically create a new incident? On the stable versions there will be created automatically.

Korthoutrody commented 5 years ago

@michaelOrtnerINFO Im sick right but I need something similar for work so ill be trying that monday.

realraphi commented 5 years ago

@Korthoutrody Did you maybe already find a way to get the incident creation working as it does on stable releases? Your workaround is pretty helpful, but it's probably not ideal for documentation of completed schedules since it'll get cluttered.

Korthoutrody commented 5 years ago

I added my own query in the statuspage controller to show all historic schedules in the incident timeline.

On Thu, 25 Jul 2019, 12:47 realraphi, notifications@github.com wrote:

@Korthoutrody https://github.com/Korthoutrody Did you maybe already find a way to get the incident creation working as it does on stable releases? Your workaround is pretty helpful, but it's probably not ideal for documentation of completed schedules since it'll get cluttered from my point of view.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CachetHQ/Cachet/issues/3626?email_source=notifications&email_token=AK5KRY22XWLBMZG7NJMJS5TQBGAEDA5CNFSM4HQMAHW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2ZDOAI#issuecomment-514995969, or mute the thread https://github.com/notifications/unsubscribe-auth/AK5KRY2P6VOXRXBAWPIRLM3QBGAEDANCNFSM4HQMAHWQ .

realraphi commented 5 years ago

Maybe this helps someone, but I extended the Schedule Controller to automatically create a new incident when creating a scheduled maintenance. I'm aware that in this example data won't get validated properly. https://github.com/realraphi/Cachet/commit/8eaf6c48d3575a6c5c74dbcb457fb763b0fd9ed2

First, we need to import the Incident model: use CachetHQ\Cachet\Models\Incident;

And then the details from the schedule form get assigned to a new array data, from which a new incident will be created:

    public function addScheduleAction()
    {
        try {
            execute(new CreateScheduleCommand(
                Binput::get('name'),
                Binput::get('message', null, false, false),
                Binput::get('status', Schedule::UPCOMING),
                Binput::get('scheduled_at'),
                Binput::get('completed_at'),
                Binput::get('components', []),
                Binput::get('notify', false)
            ));

            $data = [
                'user_id'  => 1,
                'name'     => Binput::get('name'),
                'message'  => Binput::get('message', null, false, false),
                'status'   => 4,
                'notify'   => 0,
                'visible'  => 1,
                'stickied' => false,
                'component_id' => 0
            ];

            if (Binput::get('completed_at') == "") {
              $data['occurred_at'] = Binput::get('scheduled_at') . ':00';
            } else {
              $data['occurred_at'] = Binput::get('completed_at') . ':00';
            }
            // Create a new incident
            $incident = Incident::create($data);

        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.schedule.create')
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.edit.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('dashboard.schedule')
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.add.success')));
    }

It's not pretty and just some quick code, but it works. Some drawbacks are:

TheBags commented 5 years ago

New 2.4.0-dev today installation.

Maintenanche request screenshot

Here's the error in laravel.log:

DETAIL:  Failing row contains (3, default, {\"displayName\":\"CachetHQ\\\\Cachet\\\\Notifications\\\\Schedule\\\\NewSc..., 0, null, null, 1565771586, 1565771586). (SQL: insert into \"jobs\" (\"queue\", \"attempts\", \"reserved_at\", \"available_at\", \"created_at\", \"payload\") values (default, 0, , 1565771586, 1565771586, {\"displayName\":\"CachetHQ\\\\Cachet\\\\Notifications\\\\Schedule\\\\NewScheduleNotification\",\"job\":\"Illuminate\\\\Queue\\\\CallQueuedHandler@call\",\"maxTries\":null,\"timeout\":null,\"timeoutAt\":null,\"data\":{\"commandName\":\"Illuminate\\\\Notifications\\\\SendQueuedNotifications\",\"command\":\"O:48:\\\"Illuminate\\\\Notifications\\\\SendQueuedNotifications\\\":11:{s:11:\\\"notifiables\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":4:{s:5:\\\"class\\\";s:33:\\\"CachetHQ\\\\Cachet\\\\Models\\\\Subscriber\\\";s:2:\\\"id\\\";i:1;s:9:\\\"relations\\\";a:1:{i:0;s:13:\\\"subscriptions\\\";}s:10:\\\"connection\\\";s:5:\\\"pgsql\\\";}s:12:\\\"notification\\\";O:62:\\\"CachetHQ\\\\Cachet\\\\Notifications\\\\Schedule\\\\NewScheduleNotification\\\":9:{s:11:\\\"\\u0000*\\u0000schedule\\\";O:44:\\\"CachetHQ\\\\Cachet\\\\Presenters\\\\SchedulePresenter\\\":2:{s:8:\\\"\\u0000*\\u0000dates\\\";O:42:\\\"CachetHQ\\\\Cachet\\\\Services\\\\Dates\\\\DateFactory\\\":2:{s:14:\\\"\\u0000*\\u0000appTimezone\\\";s:3:\\\"UTC\\\";s:17:\\\"\\u0000*\\u0000cachetTimezone\\\";s:11:\\\"Europe\\/Rome\\\";}s:16:\\\"\\u0000*\\u0000wrappedObject\\\";O:31:\\\"CachetHQ\\\\Cachet\\\\Models\\\\Schedule\\\":30:{s:13:\\\"\\u0000*\\u0000attributes\\\";a:8:{s:6:\\\"status\\\";s:1:\\\"0\\\";s:12:\\\"completed_at\\\";s:19:\\\"2019-08-14 12:00:00\\\";s:4:\\\"name\\\";s:13:\\\"System Update\\\";s:7:\\\"message\\\";s:34:\\\"We're planning to upgrade hardware\\\";s:12:\\\"scheduled_at\\\";s:19:\\\"2019-08-14 10:00:00\\\";s:10:\\\"updated_at\\\";s:19:\\\"2019-08-14 08:33:06\\\";s:10:\\\"created_at\\\";s:19:\\\"2019-08-14 08:33:06\\\";s:2:\\\"id\\\";i:3;}s:8:\\\"\\u0000*\\u0000casts\\\";a:5:{s:4:\\\"name\\\";s:6:\\\"string\\\";s:7:\\\"message\\\";s:6:\\\"string\\\";s:6:\\\"status\\\";s:3:\\\"int\\\";s:12:\\\"scheduled_at\\\";s:8:\\\"datetime\\\";s:12:\\\"completed_at\\\";s:8:\\\"datetime\\\";}s:11:\\\"\\u0000*\\u0000fillable\\\";a:7:{i:0;s:4:\\\"name\\\";i:1;s:7:\\\"message\\\";i:2;s:6:\\\"status\\\";i:3;s:12:\\\"scheduled_at\\\";i:4;s:12:\\\"completed_at\\\";i:5;s:10:\\\"created_at\\\";i:6;s:10:\\\"updated_at\\\";}s:5:\\\"rules\\\";a:3:{s:4:\\\"name\\\";s:15:\\\"required|string\\\";s:7:\\\"message\\\";s:15:\\\"nullable|string\\\";s:6:\\\"status\\\";s:24:\\\"required|int|between:0,2\\\";}s:13:\\\"\\u0000*\\u0000searchable\\\";a:3:{i:0;s:2:\\\"id\\\";i:1;s:4:\\\"name\\\";i:2;s:6:\\\"status\\\";}s:11:\\\"\\u0000*\\u0000sortable\\\";a:7:{i:0;s:2:\\\"id\\\";i:1;s:4:\\\"name\\\";i:2;s:6:\\\"status\\\";i:3;s:12:\\\"scheduled_at\\\";i:4;s:12:\\\"completed_at\\\";i:5;s:10:\\\"created_at\\\";i:6;s:10:\\\"updated_at\\\";}s:7:\\\"\\u0000*\\u0000with\\\";a:1:{i:0;s:10:\\\"components\\\";}s:13:\\\"\\u0000*\\u0000connection\\\";s:5:\\\"pgsql\\\";s:8:\\\"\\u0000*\\u0000table\\\";s:9:\\\"schedules\\\";s:13:\\\"\\u0000*\\u0000primaryKey\\\";s:2:\\\"id\\\";s:10:\\\"\\u0000*\\u0000keyType\\\";s:3:\\\"int\\\";s:12:\\\"incrementing\\\";b:1;s:12:\\\"\\u0000*\\u0000withCount\\\";a:0:{}s:10:\\\"\\u0000*\\u0000perPage\\\";i:15;s:6:\\\"exists\\\";b:1;s:18:\\\"wasRecentlyCreated\\\";b:1;s:11:\\\"\\u0000*\\u0000original\\\";a:8:{s:6:\\\"status\\\";s:1:\\\"0\\\";s:12:\\\"completed_at\\\";s:19:\\\"2019-08-14 12:00:00\\\";s:4:\\\"name\\\";s:13:\\\"System Update\\\";s:7:\\\"message\\\";s:34:\\\"We're planning to upgrade hardware\\\";s:12:\\\"scheduled_at\\\";s:19:\\\"2019-08-14 10:00:00\\\";s:10:\\\"updated_at\\\";s:19:\\\"2019-08-14 08:33:06\\\";s:10:\\\"created_at\\\";s:19:\\\"2019-08-14 08:33:06\\\";s:2:\\\"id\\\";i:3;}s:10:\\\"\\u0000*\\u0000changes\\\";a:0:{}s:8:\\\"\\u0000*\\u0000dates\\\";a:0:{}s:13:\\\"\\u0000*\\u0000dateFormat\\\";N;s:10:\\\"\\u0000*\\u0000appends\\\";a:0:{}s:19:\\\"\\u0000*\\u0000dispatchesEvents\\\";a:0:{}s:14:\\\"\\u0000*\\u0000observables\\\";a:0:{}s:12:\\\"\\u0000*\\u0000relations\\\";a:0:{}s:10:\\\"\\u0000*\\u0000touches\\\";a:0:{}s:10:\\\"timestamps\\\";b:1;s:9:\\\"\\u0000*\\u0000hidden\\\";a:0:{}s:10:\\\"\\u0000*\\u0000visible\\\";a:0:{}s:10:\\\"\\u0000*\\u0000guarded\\\";a:1:{i:0;s:1:\\\"*\\\";}s:16:\\\"\\u0000*\\u0000forceDeleting\\\";b:0;}}s:2:\\\"id\\\";s:36:\\\"69aaaf9b-2069-4073-aba6-995fd97f512f\\\";s:6:\\\"locale\\\";N;s:10:\\\"connection\\\";N;s:5:\\\"queue\\\";N;s:15:\\\"chainConnection\\\";N;s:10:\\\"chainQueue\\\";N;s:5:\\\"delay\\\";N;s:7:\\\"chained\\\";a:0:{}}s:8:\\\"channels\\\";a:1:{i:0;s:4:\\\"mail\\\";}s:5:\\\"tries\\\";N;s:7:\\\"timeout\\\";N;s:10:\\\"connection\\\";N;s:5:\\\"queue\\\";N;s:15:\\\"chainConnection\\\";N;s:10:\\\"chainQueue\\\";N;s:5:\\\"delay\\\";N;s:7:\\\"chained\\\";a:0:{}}\"}}) returning \"id\") at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\\DBAL\\Driver\\PDOException(code: 23502): SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column \"reserved\" violates not-null constraint
DETAIL:  Failing row contains (3, default, {\"displayName\":\"CachetHQ\\\\Cachet\\\\Notifications\\\\Schedule\\\\NewSc..., 0, null, null, 1565771586, 1565771586). at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119, PDOException(code: 23502): SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column \"reserved\" violates not-null constraint
DETAIL:  Failing row contains (3, default, {\"displayName\":\"CachetHQ\\\\Cachet\\\\Notifications\\\\Schedule\\\\NewSc..., 0, null, null, 1565771586, 1565771586). at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\\Database\\Connection->runQueryCallback('insert into \"jo...', Array, Object(Closure))
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(333): Illuminate\\Database\\Connection->run('insert into \"jo...', Array, Object(Closure))
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(304): Illuminate\\Database\\Connection->select('insert into \"jo...', Array, false)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php(20): Illuminate\\Database\\Connection->selectFromWriteConnection('insert into \"jo...', Array)
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2628): Illuminate\\Database\\Query\\Processors\\PostgresProcessor->processInsertGetId(Object(Illuminate\\Database\\Query\\Builder), 'insert into \"jo...', Array, NULL)
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(161): Illuminate\\Database\\Query\\Builder->insertGetId(Array)
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(82): Illuminate\\Queue\\DatabaseQueue->pushToDatabase(NULL, '{\"displayName\":...')
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(184): Illuminate\\Queue\\DatabaseQueue->push(Object(Illuminate\\Notifications\\SendQueuedNotifications))
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(160): Illuminate\\Bus\\Dispatcher->pushCommandToQueue(Object(Illuminate\\Queue\\DatabaseQueue), Object(Illuminate\\Notifications\\SendQueuedNotifications))
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(73): Illuminate\\Bus\\Dispatcher->dispatchToQueue(Object(Illuminate\\Notifications\\SendQueuedNotifications))
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php(195): Illuminate\\Bus\\Dispatcher->dispatch(Object(Illuminate\\Notifications\\SendQueuedNotifications))
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php(74): Illuminate\\Notifications\\NotificationSender->queueNotification(Object(Illuminate\\Database\\Eloquent\\Collection), Object(CachetHQ\\Cachet\\Notifications\\Schedule\\NewScheduleNotification))
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php(39): Illuminate\\Notifications\\NotificationSender->send(Object(Illuminate\\Database\\Eloquent\\Collection), Object(CachetHQ\\Cachet\\Notifications\\Schedule\\NewScheduleNotification))
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Notifications/RoutesNotifications.php(18): Illuminate\\Notifications\\ChannelManager->send(Object(CachetHQ\\Cachet\\Models\\Subscriber), Object(CachetHQ\\Cachet\\Notifications\\Schedule\\NewScheduleNotification))
#14 /var/www/html/app/Bus/Handlers/Events/Schedule/SendScheduleEmailNotificationHandler.php(60): CachetHQ\\Cachet\\Models\\Subscriber->notify(Object(CachetHQ\\Cachet\\Notifications\\Schedule\\NewScheduleNotification))
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Collection.php(419): CachetHQ\\Cachet\\Bus\\Handlers\\Events\\Schedule\\SendScheduleEmailNotificationHandler->CachetHQ\\Cachet\\Bus\\Handlers\\Events\\Schedule\\{closure}(Object(CachetHQ\\Cachet\\Models\\Subscriber), 0)
#16 /var/www/html/app/Bus/Handlers/Events/Schedule/SendScheduleEmailNotificationHandler.php(61): Illuminate\\Support\\Collection->each(Object(Closure))
#17 [internal function]: CachetHQ\\Cachet\\Bus\\Handlers\\Events\\Schedule\\SendScheduleEmailNotificationHandler->handle(Object(CachetHQ\\Cachet\\Bus\\Events\\Schedule\\ScheduleWasCreatedEvent))
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(379): call_user_func_array(Array, Array)
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(209): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}('CachetHQ\\\\Cachet...', Array)
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(482): Illuminate\\Events\\Dispatcher->dispatch('CachetHQ\\\\Cachet...')
#21 /var/www/html/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php(69): event(Object(CachetHQ\\Cachet\\Bus\\Events\\Schedule\\ScheduleWasCreatedEvent))
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(90): CachetHQ\\Cachet\\Bus\\Handlers\\Commands\\Schedule\\CreateScheduleCommandHandler->handle(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand))
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand))
#24 /var/www/html/vendor/alt-three/validator/src/ValidatingMiddleware.php(63): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand))
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): AltThree\\Validator\\ValidatingMiddleware->handle(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand), Object(Closure))
#26 /var/www/html/app/Bus/Middleware/UseDatabaseTransactions.php(35): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand))
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(29): CachetHQ\\Cachet\\Bus\\Middleware\\UseDatabaseTransactions->CachetHQ\\Cachet\\Bus\\Middleware\\{closure}(Object(Illuminate\\Database\\PostgresConnection))
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(327): Illuminate\\Database\\Connection->transaction(Object(Closure))
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(237): Illuminate\\Database\\DatabaseManager->__call('transaction', Array)
#30 /var/www/html/app/Bus/Middleware/UseDatabaseTransactions.php(36): Illuminate\\Support\\Facades\\Facade::__callStatic('transaction', Array)
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): CachetHQ\\Cachet\\Bus\\Middleware\\UseDatabaseTransactions->handle(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand), Object(Closure))
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand))
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#34 /var/www/html/app/helpers.php(194): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand))
#35 /var/www/html/app/Http/Controllers/Dashboard/ScheduleController.php(101): execute(Object(CachetHQ\\Cachet\\Bus\\Commands\\Schedule\\CreateScheduleCommand))
#36 [internal function]: CachetHQ\\Cachet\\Http\\Controllers\\Dashboard\\ScheduleController->addScheduleAction()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('addScheduleActi...', Array)
#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(CachetHQ\\Cachet\\Http\\Controllers\\Dashboard\\ScheduleController), 'addScheduleActi...')
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(682): Illuminate\\Routing\\Route->run()
#42 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#43 /var/www/html/app/Http/Middleware/Authenticate.php(61): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): CachetHQ\\Cachet\\Http\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#45 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#46 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#47 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#49 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(75): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#50 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#53 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#54 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#55 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#56 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#57 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#58 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#59 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#60 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#62 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#63 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#64 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#65 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(684): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#66 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(659): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#67 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#68 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(614): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#69 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#70 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#71 /var/www/html/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(65): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#72 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#73 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#74 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#75 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#76 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#77 /var/www/html/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#78 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#79 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#80 /var/www/html/vendor/barryvdh/laravel-cors/src/HandlePreflight.php(29): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#81 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Barryvdh\\Cors\\HandlePreflight->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#82 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#83 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#84 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#85 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#86 /var/www/html/public/index.php(54): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#87 {main}
"} 

the SQLSTATE:

SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "reserved" violates not-null constraint
DETAIL:  Failing row contains (4, default, {"displayName":"CachetHQ\\Cachet\\Notifications\\Schedule\\NewSc..., 0, null, null, 1565772114, 1565772114). (SQL: insert into "jobs" ("queue", "attempts", "reserved_at", "available_at", "created_at", "payload") values (default, 0, , 1565772114, 1565772114, {"displayName":"CachetHQ\\Cachet\\Notifications\\Schedule\\NewScheduleNotification","job":"Illuminate\\Queue\\CallQueuedHandler@call","maxTries":null,"timeout":null,"timeoutAt":null,"data":{"commandName":"Illuminate\\Notifications\\SendQueuedNotifications","command":"O:48:\"Illuminate\\Notifications\\SendQueuedNotifications\":11:{s:11:\"notifiables\";O:45:\"Illuminate\\Contracts\\Database\\ModelIdentifier\":4:{s:5:\"class\";s:33:\"CachetHQ\\Cachet\\Models\\Subscriber\";s:2:\"id\";i:1;s:9:\"relations\";a:1:{i:0;s:13:\"subscriptions\";}s:10:\"connection\";s:5:\"pgsql\";}s:12:\"notification\";O:62:\"CachetHQ\\Cachet\\Notifications\\Schedule\\NewScheduleNotification\":9:{s:11:\"\u0000*\u0000schedule\";O:44:\"CachetHQ\\Cachet\\Presenters\\SchedulePresenter\":2:{s:8:\"\u0000*\u0000dates\";O:42:\"CachetHQ\\Cachet\\Services\\Dates\\DateFactory\":2:{s:14:\"\u0000*\u0000appTimezone\";s:3:\"UTC\";s:17:\"\u0000*\u0000cachetTimezone\";s:11:\"Europe\/Rome\";}s:16:\"\u0000*\u0000wrappedObject\";O:31:\"CachetHQ\\Cachet\\Models\\Schedule\":30:{s:13:\"\u0000*\u0000attributes\";a:8:{s:6:\"status\";s:1:\"0\";s:12:\"completed_at\";s:19:\"2019-08-14 12:00:00\";s:4:\"name\";s:5:\"pippo\";s:7:\"message\";s:5:\"pippo\";s:12:\"scheduled_at\";s:19:\"2019-08-14 10:00:00\";s:10:\"updated_at\";s:19:\"2019-08-14 08:41:54\";s:10:\"created_at\";s:19:\"2019-08-14 08:41:54\";s:2:\"id\";i:4;}s:8:\"\u0000*\u0000casts\";a:5:{s:4:\"name\";s:6:\"string\";s:7:\"message\";s:6:\"string\";s:6:\"status\";s:3:\"int\";s:12:\"scheduled_at\";s:8:\"datetime\";s:12:\"completed_at\";s:8:\"datetime\";}s:11:\"\u0000*\u0000fillable\";a:7:{i:0;s:4:\"name\";i:1;s:7:\"message\";i:2;s:6:\"status\";i:3;s:12:\"scheduled_at\";i:4;s:12:\"completed_at\";i:5;s:10:\"created_at\";i:6;s:10:\"updated_at\";}s:5:\"rules\";a:3:{s:4:\"name\";s:15:\"required|string\";s:7:\"message\";s:15:\"nullable|string\";s:6:\"status\";s:24:\"required|int|between:0,2\";}s:13:\"\u0000*\u0000searchable\";a:3:{i:0;s:2:\"id\";i:1;s:4:\"name\";i:2;s:6:\"status\";}s:11:\"\u0000*\u0000sortable\";a:7:{i:0;s:2:\"id\";i:1;s:4:\"name\";i:2;s:6:\"status\";i:3;s:12:\"scheduled_at\";i:4;s:12:\"completed_at\";i:5;s:10:\"created_at\";i:6;s:10:\"updated_at\";}s:7:\"\u0000*\u0000with\";a:1:{i:0;s:10:\"components\";}s:13:\"\u0000*\u0000connection\";s:5:\"pgsql\";s:8:\"\u0000*\u0000table\";s:9:\"schedules\";s:13:\"\u0000*\u0000primaryKey\";s:2:\"id\";s:10:\"\u0000*\u0000keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:12:\"\u0000*\u0000withCount\";a:0:{}s:10:\"\u0000*\u0000perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:1;s:11:\"\u0000*\u0000original\";a:8:{s:6:\"status\";s:1:\"0\";s:12:\"completed_at\";s:19:\"2019-08-14 12:00:00\";s:4:\"name\";s:5:\"pippo\";s:7:\"message\";s:5:\"pippo\";s:12:\"scheduled_at\";s:19:\"2019-08-14 10:00:00\";s:10:\"updated_at\";s:19:\"2019-08-14 08:41:54\";s:10:\"created_at\";s:19:\"2019-08-14 08:41:54\";s:2:\"id\";i:4;}s:10:\"\u0000*\u0000changes\";a:0:{}s:8:\"\u0000*\u0000dates\";a:0:{}s:13:\"\u0000*\u0000dateFormat\";N;s:10:\"\u0000*\u0000appends\";a:0:{}s:19:\"\u0000*\u0000dispatchesEvents\";a:0:{}s:14:\"\u0000*\u0000observables\";a:0:{}s:12:\"\u0000*\u0000relations\";a:0:{}s:10:\"\u0000*\u0000touches\";a:0:{}s:10:\"timestamps\";b:1;s:9:\"\u0000*\u0000hidden\";a:0:{}s:10:\"\u0000*\u0000visible\";a:0:{}s:10:\"\u0000*\u0000guarded\";a:1:{i:0;s:1:\"*\";}s:16:\"\u0000*\u0000forceDeleting\";b:0;}}s:2:\"id\";s:36:\"5723a5e9-8d21-42f5-b8ad-9a189d535360\";s:6:\"locale\";N;s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:0:{}}s:8:\"channels\";a:1:{i:0;s:4:\"mail\";}s:5:\"tries\";N;s:7:\"timeout\";N;s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:0:{}}"}}) returning "id")

and the Debug Error screenshot

tnx, TheBags

clmssz commented 5 years ago

Same here

[2019-09-26 14:01:13] production.ERROR: PDOException: SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "reserved" violates not-null constraint                                               DETAIL:  Failing row contains (2, default, {"displayName":"CachetHQ\\Cachet\\Notifications\\Schedule\\NewSc..., 0, null, null, 1569506473, 1569506473). in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
astrakid commented 5 years ago

Works for me. But I am not able to remove an end date. In addition I think it would be very helpful to have a planned end instead of completed_at, because the actual timestamp when i change the schedule to completed could be taken as "completed_at" timestamp.

SC-cmarquardt commented 5 years ago

@TheBags @clmssz I can confirm the behaviour: A new maintenance with active notifcations results in a SQL Exception

SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "reserved" violates not-null constraint

DETAIL:  Failing row contains (5, default, {"displayName":"CachetHQ\\Cachet\\Notifications\\Schedule\\NewSc..., 0, null, null, 1570778542, 1570778542). (SQL: insert into "chq_jobs" ("queue", "attempts", "reserved_at", "available_at", "created_at", "payload") values (default, 0, , 1570778542, 1570778542, {"displayName":"CachetHQ\\Cachet\\Notifications\\Schedule\\NewScheduleNotification","job":"Illuminate\\Queue\\CallQueuedHandler@call","maxTries":null,"timeout":null,"timeoutAt":null,"data":{"commandName":"Illuminate\\Notifications\\SendQueuedNotifications","command":"O:48:\"Illuminate\\Notifications\\SendQueuedNotifications\":11:{s:11:\"notifiables\";O:45:\"Illuminate\\Contracts\\Database\\ModelIdentifier\":4:{s:5:\"class\";s:33:\"CachetHQ\\Cachet\\Models\\Subscriber\";s:2:\"id\";i:1;s:9:\"relations\";a:1:{i:0;s:13:\"subscriptions\";}s:10:\"connection\";s:5:\"pgsql\";}s:12:\"notification\";O:62:\"CachetHQ\\Cachet\\Notifications\\Schedule\\NewScheduleNotification\":9:{s:11:\"\u0000*\u0000schedule\";O:44:\"CachetHQ\\Cachet\\Presenters\\SchedulePresenter\":2:{s:8:\"\u0000*\u0000dates\";O:42:\"CachetHQ\\Cachet\\Services\\Dates\\DateFactory\":2:{s:14:\"\u0000*\u0000appTimezone\";s:3:\"UTC\";s:17:\"\u0000*\u0000cachetTimezone\";s:13:\"Europe\/Berlin\";}s:16:\"\u0000*\u0000wrappedObject\";O:31:\"CachetHQ\\Cachet\\Models\\Schedule\":30:{s:13:\"\u0000*\u0000attributes\";a:8:{s:6:\"status\";s:1:\"0\";s:12:\"completed_at\";N;s:4:\"name\";s:16:\"Test maintenance\";s:7:\"message\";s:16:\"Test maintenance\";s:12:\"scheduled_at\";s:19:\"2019-10-11 10:00:00\";s:10:\"updated_at\";s:19:\"2019-10-11 07:22:22\";s:10:\"created_at\";s:19:\"2019-10-11 07:22:22\";s:2:\"id\";i:8;}s:8:\"\u0000*\u0000casts\";a:5:{s:4:\"name\";s:6:\"string\";s:7:\"message\";s:6:\"string\";s:6:\"status\";s:3:\"int\";s:12:\"scheduled_at\";s:8:\"datetime\";s:12:\"completed_at\";s:8:\"datetime\";}s:11:\"\u0000*\u0000fillable\";a:7:{i:0;s:4:\"name\";i:1;s:7:\"message\";i:2;s:6:\"status\";i:3;s:12:\"scheduled_at\";i:4;s:12:\"completed_at\";i:5;s:10:\"created_at\";i:6;s:10:\"updated_at\";}s:5:\"rules\";a:3:{s:4:\"name\";s:15:\"required|string\";s:7:\"message\";s:15:\"nullable|string\";s:6:\"status\";s:24:\"required|int|between:0,2\";}s:13:\"\u0000*\u0000searchable\";a:3:{i:0;s:2:\"id\";i:1;s:4:\"name\";i:2;s:6:\"status\";}s:11:\"\u0000*\u0000sortable\";a:7:{i:0;s:2:\"id\";i:1;s:4:\"name\";i:2;s:6:\"status\";i:3;s:12:\"scheduled_at\";i:4;s:12:\"completed_at\";i:5;s:10:\"created_at\";i:6;s:10:\"updated_at\";}s:7:\"\u0000*\u0000with\";a:1:{i:0;s:10:\"components\";}s:13:\"\u0000*\u0000connection\";s:5:\"pgsql\";s:8:\"\u0000*\u0000table\";s:9:\"schedules\";s:13:\"\u0000*\u0000primaryKey\";s:2:\"id\";s:10:\"\u0000*\u0000keyType\";s:3:\"int\";s:12:\"incrementing\";b:1;s:12:\"\u0000*\u0000withCount\";a:0:{}s:10:\"\u0000*\u0000perPage\";i:15;s:6:\"exists\";b:1;s:18:\"wasRecentlyCreated\";b:1;s:11:\"\u0000*\u0000original\";a:8:{s:6:\"status\";s:1:\"0\";s:12:\"completed_at\";N;s:4:\"name\";s:16:\"Test maintenance\";s:7:\"message\";s:16:\"Test maintenance\";s:12:\"scheduled_at\";s:19:\"2019-10-11 10:00:00\";s:10:\"updated_at\";s:19:\"2019-10-11 07:22:22\";s:10:\"created_at\";s:19:\"2019-10-11 07:22:22\";s:2:\"id\";i:8;}s:10:\"\u0000*\u0000changes\";a:0:{}s:8:\"\u0000*\u0000dates\";a:0:{}s:13:\"\u0000*\u0000dateFormat\";N;s:10:\"\u0000*\u0000appends\";a:0:{}s:19:\"\u0000*\u0000dispatchesEvents\";a:0:{}s:14:\"\u0000*\u0000observables\";a:0:{}s:12:\"\u0000*\u0000relations\";a:0:{}s:10:\"\u0000*\u0000touches\";a:0:{}s:10:\"timestamps\";b:1;s:9:\"\u0000*\u0000hidden\";a:0:{}s:10:\"\u0000*\u0000visible\";a:0:{}s:10:\"\u0000*\u0000guarded\";a:1:{i:0;s:1:\"*\";}s:16:\"\u0000*\u0000forceDeleting\";b:0;}}s:2:\"id\";s:36:\"0ff40664-6f13-4a3c-8537-ee579e31301d\";s:6:\"locale\";N;s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:0:{}}s:8:\"channels\";a:1:{i:0;s:4:\"mail\";}s:5:\"tries\";N;s:7:\"timeout\";N;s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:0:{}}"}}) returning "id")
Kopertje commented 5 years ago

I got the same issue with 2.4. I would like to have a solution for this. Has anyone found this? Or when i expect to get this fixed?

popindavibe commented 5 years ago

There are several issues gathered in this thread. Mine also started when I activated the email notifications. Once I did this email notifications would be sent but the maintenance would not be created in Cachet (error 500). Looking at the Laravel logs, I saw:

[2019-11-10 13:27:56] production.ERROR: RuntimeException: GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler. in /opt/Cachet/vendor/guzzlehttp/guzzle/src/functions.php:119
Stack trace:
#0 /opt/Cachet/vendor/php-http/guzzle6-adapter/src/Client.php(78): GuzzleHttp\choose_handler()
#1 /opt/Cachet/vendor/php-http/guzzle6-adapter/src/Client.php(31): Http\Adapter\Guzzle6\Client::buildClient()

After a search, installing php7.3-curl fixed my issue. Since I also moved to php7.3 around the same time, it may just be that I missed to install that package at the time.

jzinkweg commented 4 years ago

This is caused by the removal of the "reserved" column: https://github.com/illuminate/queue/commit/061851bd2ff07aa3b9bddcd197c7ff6ae714622d#diff-fd99f8447bff90123d06344bfe84dd89 Dropping the column fixes the problem.

honeybajaj commented 4 years ago

I have got a fresh installation of Cachet version 2.4.0-dev, I am not able to notify user (email) for scheduled maintenance. Whenever I add a new maintenance schedule with notify subscriber checked, I get redirected to 500 Error page. If I uncheck notify subscriber and create maintenance schedule, schedule gets created but no notification goes out. Can you suggest possible resolution. Just fyi, emails are working for incidents though.

jbrooksuk commented 1 year ago

Thank you for your input on Cachet 2.x. We are shifting our attention and resources to Cachet 3.x and will no longer be supporting the 2.x version. If your feedback or issue is relevant to the 3.x series, we encourage you to engage with the new branch.

For more information on the Cachet rebuild and our plans for 3.x, you can read the announcement here.

We appreciate your understanding and look forward to your contributions to the new version.