Mixpost
-
@girish something is keeping horizon alive. Dima and I have no clue what or how. This cron job isn't doing that. Any idea what's going on? Is there some function that comes preinstalled with Cloudron that could be replacing/handling the supervisor job?
* * * * * cd /app/data/mixpost-pro-team-app && php artisan schedule:run >> /app/data/null 2>&1
-
@privsec a fresh install will get you to v1 but you might still encounter an error when running php artisan migrate. In that case, follow my post above the upgrade guide to get that sorted out. I think we’ll encounter the same issues when upgrading in the future because the file ownership defaults to root and not www-data for newly added files, so the upgrade guide should apply to future updates.
-
@humptydumpty Ayeee! GG +1
Well done. I have not messed with my instance recently - my Horizon would eventually kill or become inactive somehow and I would have to manually restart.I was planning on a rebuild and more TS so i will test your steps and report back
-
@plusone-nick I just checked Horizon and it's still running on my instance. I linked Twitter yesterday and made two posts which worked as intended. I think we got a working and stable guide going for Mixpost! The only issue left is figuring out the Horizon magic. How is it alive?! It feels like we created Frankenstein and now trying to see what makes him tick
-
@girish We sorted out all Mixpost installation errors but the Horizon mystery remains. Dima has no clue how Horizon is staying alive without Supervisor. Any thoughts?
-
@humptydumpty and @plusone-nick
Do we need to have Horizon stay alive? Is there a way we can confirm it is up, and if it is not working, what do you do? -
@privsec Horizon has to stay alive. It's a must.
Go to your domain.com/mixpost/admin/system/status page and it should all be green like this.
Also, when you ran the command:
php artisan horizon
If you wait a few seconds, you should see it report back something similar to a ping test:
bla bla bla.... 15ms
bla bla bla... 8msOtherwise, it will say KILLED instead.
If its not working, then you need to redo the installation and apply the "fix" that I posted in comment #83
-
-
@privsec Please keep in mind, I just installed it too and I haven't used the app before, so I'm in the same boat as you. However, since we worked out all the errors, the upgrade path should keep all existing posts/users/media/etc. intact.
Start with Nick's installation guide (#49) (skip step 10; somehow the app works without supervisor) and apply the fixes in #83 to get rid of the errors during the outlined steps. Yes, I believe we will have to do the fixes for each upgrade since any new files that get added by the upgrade will default to root ownership which need to be changed to www-data.
My suggestion is to try to install it the first time while keeping in mind that it's a test run just to familiarize yourself with the process. Then, you'll know when to apply the fixes during the intial installation. A cool thing you can do here is to create a backup of the fresh LAMP that you can restore to. If you delete the app and reinstall it, then all the credentials (mysql, phpmyadmin, etc.) will change.
One thing that wasn't mentioned yet, during the installation, you'll be asked "do you want to save these credentials". Say Yes!
I feel comfortable enough to start using the app for my own use. I wouldn't dare give it out to paid clients since it's not a packaged app and Horizon is working automagically but no one knows how because it shouldn't be able to stay alive! With that said, Cloudron backups work and the app itself is stable enough for production use.
-
@privsec I just realized my mistake. For the initial installation follow #49 (skip step 10; somehow the app works without supervisor) and apply the fixes in #83 to get rid of the errors during the outlined steps.
In the future when you need to upgrade from v1.0 to v1.X, follow the upgrade guide in comment #84 and apply the fixes in comment #83. If you do #49 again, user data won't transfer over.
-
@humptydumpty interesting. LAMP app has no special code to run horizon in the background. There must be something else running it. Have you tried to use ps to figure out what the parent process of horizon is?
-
@girish I ran ps aux (had to look that up, I love that you're mistaking my copy/paste skills with actual coding knowledge )
root@fb19c14f-edfa-432b-b7a1-89f306948ce0:/app/data/mixpost-pro-team-app# ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 320052 53260 pts/0 Ss+ Aug21 0:13 /usr/sbin/apache2 -DFOREGROUND root 17 0.0 0.0 2928 1008 pts/0 S+ Aug21 0:00 /bin/cat root 18 0.0 0.0 2928 1000 pts/0 S+ Aug21 0:01 /bin/cat root 22 0.0 0.0 5048 4032 pts/1 Ss Aug21 0:00 /bin/bash root 34 0.1 0.2 292272 80148 pts/1 S+ Aug21 3:33 php artisan horizon root 36 0.1 0.2 292276 79832 pts/1 S+ Aug21 3:36 /usr/bin/php8.1 artisan horizon:supervisor fb19c14f-edfa-432b-b7a1-89f306948ce0-CXZh:supervisor-1 redis --workers-name=default --balance=auto -- root 37 0.1 0.2 292276 80208 pts/1 S+ Aug21 3:22 /usr/bin/php8.1 artisan horizon:supervisor fb19c14f-edfa-432b-b7a1-89f306948ce0-CXZh:mixpost-heavy mixpost-redis --workers-name=default --balanc root 1528 0.0 0.2 369804 90236 pts/1 S+ Aug21 1:09 /usr/bin/php8.1 artisan horizon:work mixpost-redis --name=default --supervisor=fb19c14f-edfa-432b-b7a1-89f306948ce0-CXZh:mixpost-heavy --backoff www-data 9960 0.1 0.1 321308 43272 pts/0 S+ 02:25 0:02 /usr/sbin/apache2 -DFOREGROUND www-data 10041 0.2 0.1 321056 42980 pts/0 S+ 02:44 0:00 /usr/sbin/apache2 -DFOREGROUND root 10042 0.0 0.0 5048 4012 pts/2 Ss 02:45 0:00 /bin/bash root 10078 6.8 0.2 292228 79640 pts/1 S+ 02:49 0:00 /usr/bin/php8.1 artisan horizon:work redis --name=default --supervisor=fb19c14f-edfa-432b-b7a1-89f306948ce0-CXZh:supervisor-1 --backoff=0 --max- root 10083 0.0 0.0 7480 3224 pts/2 R+ 02:49 0:00 ps aux
Edit: old dog learned a new trick (ps auxf)
root@fb19c14f-edfa-432b-b7a1-89f306948ce0:/app/data/mixpost-pro-team-app# ps auxf USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 10042 0.0 0.0 5048 4016 pts/2 Ss 02:45 0:00 /bin/bash root 10148 0.0 0.0 7480 3084 pts/2 R+ 03:04 0:00 \_ ps auxf root 22 0.0 0.0 5048 4032 pts/1 Ss Aug21 0:00 /bin/bash root 34 0.1 0.2 292272 80148 pts/1 S+ Aug21 3:35 \_ php artisan horizon root 36 0.1 0.2 292276 79832 pts/1 S+ Aug21 3:38 \_ /usr/bin/php8.1 artisan horizon:supervisor fb19c14f-edfa-432b-b7a1-89f306948ce0-CXZh:supervisor-1 redis --workers-name=default --balance root 10143 0.9 0.2 292228 79708 pts/1 S+ 03:03 0:00 | \_ /usr/bin/php8.1 artisan horizon:work redis --name=default --supervisor=fb19c14f-edfa-432b-b7a1-89f306948ce0-CXZh:supervisor-1 --back root 37 0.1 0.2 292276 80208 pts/1 S+ Aug21 3:23 \_ /usr/bin/php8.1 artisan horizon:supervisor fb19c14f-edfa-432b-b7a1-89f306948ce0-CXZh:mixpost-heavy mixpost-redis --workers-name=default root 1528 0.0 0.2 369804 90236 pts/1 S+ Aug21 1:09 \_ /usr/bin/php8.1 artisan horizon:work mixpost-redis --name=default --supervisor=fb19c14f-edfa-432b-b7a1-89f306948ce0-CXZh:mixpost-hea root 1 0.0 0.1 320052 53260 pts/0 Ss+ Aug21 0:13 /usr/sbin/apache2 -DFOREGROUND root 17 0.0 0.0 2928 1008 pts/0 S+ Aug21 0:00 /bin/cat root 18 0.0 0.0 2928 1000 pts/0 S+ Aug21 0:01 /bin/cat www-data 9960 0.1 0.1 321308 43276 pts/0 S+ 02:25 0:04 /usr/sbin/apache2 -DFOREGROUND www-data 10041 0.1 0.1 321056 43004 pts/0 S+ 02:44 0:02 /usr/sbin/apache2 -DFOREGROUND www-data 10090 0.1 0.1 321056 42988 pts/0 S+ 02:51 0:01 /usr/sbin/apache2 -DFOREGROUND
more copy paste info i found online
root@fb19c14f-edfa-432b-b7a1-89f306948ce0:/app/data/mixpost-pro-team-app# ps -Flww -p 34 F S UID PID PPID C PRI NI ADDR SZ WCHAN RSS PSR STIME TTY TIME CMD 0 S root 34 22 0 80 0 - 73068 hrtime 80148 5 Aug21 pts/1 00:03:35 php artisan horizon root@fb19c14f-edfa-432b-b7a1-89f306948ce0:/app/data/mixpost-pro-team-app# cd /proc/34 root@fb19c14f-edfa-432b-b7a1-89f306948ce0:/proc/34# ls arch_status cgroup coredump_filter environ gid_map map_files mounts numa_maps pagemap root setgroups stat task uid_map attr clear_refs cpu_resctrl_groups exe io maps mountstats oom_adj patch_state sched smaps statm timens_offsets wchan autogroup cmdline cpuset fd limits mem net oom_score personality schedstat smaps_rollup status timers auxv comm cwd fdinfo loginuid mountinfo ns oom_score_adj projid_map sessionid stack syscall timerslack_ns root@fb19c14f-edfa-432b-b7a1-89f306948ce0:/proc/34# cat /proc/34/status Name: php Umask: 0022 State: S (sleeping) Tgid: 34 Ngid: 0 Pid: 34 PPid: 22 TracerPid: 0 Uid: 0 0 0 0 Gid: 0 0 0 0 FDSize: 256 Groups: 0 NStgid: 34 NSpid: 34 NSpgid: 34 NSsid: 22 VmPeak: 292324 kB VmSize: 292272 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 80148 kB VmRSS: 80148 kB RssAnon: 20828 kB RssFile: 37968 kB RssShmem: 21352 kB VmData: 21536 kB VmStk: 132 kB VmExe: 3020 kB VmLib: 62052 kB VmPTE: 312 kB VmSwap: 0 kB HugetlbPages: 0 kB CoreDumping: 0 THP_enabled: 1 Threads: 1 SigQ: 2/120015 SigPnd: 0000000000000000 ShdPnd: 0000000000000000 SigBlk: 0000000000000000 SigIgn: 0000000000001000 SigCgt: 0000000004024a07 CapInh: 0000000000000000 CapPrm: 00000000a80405fb CapEff: 00000000a80405fb CapBnd: 00000000a80405fb CapAmb: 0000000000000000 NoNewPrivs: 0 Seccomp: 2 Seccomp_filters: 1 Speculation_Store_Bypass: thread force mitigated SpeculationIndirectBranch: conditional force disabled Cpus_allowed: ff Cpus_allowed_list: 0-7 Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 Mems_allowed_list: 0 voluntary_ctxt_switches: 339836 nonvoluntary_ctxt_switches: 387995
-
@humptydumpty Could it be that you started
php artisan horizon
manually on a web terminal ? Have you tested that it starts up automatically after restarting the app ? (which kills all the existing web terminal sessions). -
@humptydumpty yes, correct, you can just put it in the app's cron . Alternately, the LAMP app supports a startup script - https://docs.cloudron.io/apps/lamp/#custom-startup-script .
-
App won't start. I think I know why its because the php artisan horizon has to be cd'd to /app/data/mixpost-pro-team-app/ first. How do you enter that in run.sh?startup script didn't work.After much trial and error, I got the cron method to start horizon automatically after I remembered the @service cron Girish mentioned in an earlier post.
@service cd /app/data/mixpost-pro-team-app && php artisan horizon * * * * * cd /app/data/mixpost-pro-team-app && php artisan schedule:run >> /app/data/null 2>&1
@plusone-nick add this cron to your install guide
-
I updated from Mixpost Pro v.1.0.0 to v.1.2.0 using the official Mixpost update guide. But you need to do one thing beforehand, and another at the end to complete the steps on Cloudron.
Step 1: navigate to the mixpost folder before starting the update process
cd /app/data/mixpost-pro-team-app/
Step 2: follow update guide https://docs.inovector.com/books/mixpost-pro/page/in-your-standalone-or-laravel-app
Step 3: finish it off by running
php artisan horizon
Done.
-
Starting to hit storage issues. I received a backup failed notification. The app size was around 100MB for a fresh install. Now it's 3.98 GB! I'm not really using the app yet or uploading any media so the increase must be from the last update I did (v1.0 to v1.2).
Edit: The culprit is the log file located at /mixpost-pro-team-app/storage/logs/laravel.log (in my case it grew to over 5GB!). It had a lot of Redis references. The app's Redis is green in services and is using around 1/3 of the allocated 150MB so nothing out of the ordinary. The values in the .env file match what's in the credentials.txt file so that's good too. I'll update the post if Dima finds the root cause.
a few lines of the laravel.log file: https://pastebin.com/bkWK1LGA