This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I installed October on namecheap shared hosting. I'm NOT an expert in cron jobs nor in linux. I get this error:
exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /home/[user]/sites/[sitename]/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php:287
Stack trace:
#0 /home/[user]/sites/[sitename]/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php(287): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Invalid argument...', '/home/[user]/...', 287, Array)
#1 /home/[user]/sites/[sitename]/vendor/symfony/console/Symfony/Component/Console/Application.php(823): Symfony\Component\Console\Input\ArgvInput->hasParameterOption(Array)
#2 /home/[user]/sites/[sitename]/vendor/symfony/console/Symfony/Component/Console/Application.php(123): Symfony\Component\Console\Application->configureIO(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/[user]/sites/[sitename]/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(94): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /home/[user]/sites/[sitename]/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 {main}
(where [user] is my cPanel login, and [sitename] is the domain name like "example.com" - domain DOT ext)
What other info should I post to let you help me with this issue?
Last updated
Hi alessio, please provide the step by step instructions you are following when setting up the cron. Include all the values you are entering. This will help us to understand what is happening.
I used the cPanel interface to add the cron job:
php /home/[user]/sites/[sitename]/artisan schedule:run >> /dev/null 2>&1
This is the command I entered, and this is how it looks like in cPanel:
https://www.dropbox.com/s/h6zy11pbvujj8ij/Screenshot%202016-06-19%2010.56.38.jpg?dl=0
Last updated
Try this instead:
php /home/[user]/sites/[sitename]/artisan schedule:run
i.e Remove everything after the >>
including the >>
daftspunk said:
Try this instead:
php /home/[user]/sites/[sitename]/artisan schedule:run
i.e Remove everything after the
>>
including the>>
Tried, error persists, nothing changes
P.S. in my limited understanding of linux, ">> /dev/null 2>&1" only avoids sending an email when the cron goes off, doesn't it?
Last updated
Bit of a random guess but is php the correct command for your host? On one of my hosting companies you have to use php5 otherwise it defaults to php v4.
Also are you running any plugin schedules that may be incorrectly set up?
Cron works for me on lots of hosts so it is hard to understand why you might have a problem.
axomat said:
Bit of a random guess but is php the correct command for your host? On one of my hosting companies you have to use php5 otherwise it defaults to php v4.
Also are you running any plugin schedules that may be incorrectly set up?
Cron works for me on lots of hosts so it is hard to understand why you might have a problem.
Thanks for your post. Reading the docs on namecheap PHP is v5, but I also have other problems in this install. Maybe I thrown in too many plugins to test. I'll start over with a clean install to see if the problem persists, and then I'll post an update here.
I re-installed October (clean install), but the problem is still the same. I'll check with namecheap support and then I'll post an update here.
I chatted with the support of the hosting company, and it looks like this is a non-issue.
First they suggested to change the command to:
/usr/bin/php /home/[user]/sites/[sitename]/artisan schedule:run > /dev/null 2>&1
to make sure you run with your selected version of PHP (change php to /usr/bin/php)
Then they tried to run the command from php-cli
10:39customerservice:
Seems like it does run with /usr/bin/php-cli /home/[user]/sites/[sitename]/artisan schedule:run
10:39customerservice:
with php-cli I mean
10:39customerservice:
Though the output is "No scheduled commands are ready to run."
10:43Alessio:
so the error is just that there is nothing to run?
10:44customerservice:
Yep, absolutely correct
So my understanding is that when there is nothing scheduled to process for the Cron Job, it records an issue in the Event Log that is somehow misleading. It looks like an error which should be managed by the php app without reporting any issue, IMO.
Should this be reported as a bug to the team?
Hi
The cron does not record anything in the october event log. It may log something in the web server event file but that is why the docs suggest to use > /dev/null 2>&1
So I dont think you need to log this as a bug, it works really well once you see the power of the laravel scheduling commands that you can use in plugins.
axomat said:
Hi
The cron does not record anything in the october event log. It may log something in the web server event file but that is why the docs suggest to use > /dev/null 2>&1
So I dont think you need to log this as a bug, it works really well once you see the power of the laravel scheduling commands that you can use in plugins.
It's not the cron job process that messes with October event log, but the php app itself.
It records an event every minute, which is very annoying:
https://www.dropbox.com/s/0uyx2ni9jqwsxj9/Screenshot%202016-06-20%2023.23.28.png?dl=0
If these are useless entries (as it is not really an error), why log them and not have the php app "silently" handle the exception?
If I read "Invalid argument..." I understand there is something not working, so both I did not understand what is really going on, or it is a bug.
[edit] I like October, that's why I take the effort to post on the forum and try to solve this issue
Last updated
Please paste the entire exception message, I notice in the first post you made it only shows up to number 5 in the stack trace. If we can see the full error it might shed some more light on the problem.
edit: Nevermind I see that is the entire stack trace. It looks like it doesn't even reach October and is failing at the Laravel layer.
Last updated
daftspunk said:
Please paste the entire exception message, I notice in the first post you made it only shows up to number 5 in the stack trace. If we can see the full error it might shed some more light on the problem.
edit: Nevermind I see that is the entire stack trace. It looks like it doesn't even reach October and is failing at the Laravel layer.
Do I need to deal with .htaccess like explained here?
http://octobercms.com/docs/setup/configuration#apache-configuration
I uncommented the "RewriteBase /" line, but did not add any subdirectory. Maybe, as the app is on a shared hosting server, I have to add something here?
Hey please post complete error_log. You can find in you server. Maybe you have to first higher the log level in cpanel. Did you check october logs in admin interface? Maybe they are empty. Than please paste logs from your server here.
Crazymodder said:
Hey please post complete error_log. You can find in you server. Maybe you have to first higher the log level in cpanel. Did you check october logs in admin interface? Maybe they are empty. Than please paste logs from your server here.
There're no errors in the server log, but the October's Event Log is full of the errors I posted on the first post of this thread (actually one every minute)
Last updated
1-15 of 15