Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WordPress] version problem with cron user permissions and WordPress Cron cron job #1540

Closed
mtnlion1 opened this issue May 21, 2024 · 13 comments
Assignees
Labels
solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed wordpress

Comments

@mtnlion1
Copy link

Platform

AWS

bndiagnostic ID know more about bndiagnostic ID

none

bndiagnostic output

No response

bndiagnostic was not useful. Could you please tell us why?

Problem has nothing to do with Apache. It's related to cron permissions

Describe your issue as much as you can

In order to bypass the WordPress interma; corn (which is needed on any site that gets good traffic), it's necessary to add an instruction in wp-config.php and create a corn job to run the Wordpress cron routine on a scheduled basis. The issue is that Bitnami does a cron-deny for user "daemon". However, you assign all Wordpress files to own/group "daemon". If the system cron job is run by any other user, plugin updates will fail.

I took care of this by deleting the cron-deny in /etc. However, you should not prohibit "daemon" from owning cron jobs in Wordpress instances.

@mtnlion1 mtnlion1 added the tech-issues The user has a technical issue about an application label May 21, 2024
@github-actions github-actions bot added the triage Triage is needed label May 21, 2024
@dennis6101990leon

This comment was marked as spam.

@mtnlion1
Copy link
Author

mtnlion1 commented May 22, 2024 via email

@jotamartos
Copy link
Collaborator

The instructions posted here should work for you when disabling the WordPress' cron

https://docs.bitnami.com/general/apps/wordpress/configuration/disable-wordpress-cron/

Could you please take a look at it?

@jotamartos jotamartos changed the title Wordpress version problem with cron user permissions and WordPress Cron cron job [WordPress] version problem with cron user permissions and WordPress Cron cron job May 23, 2024
@mtnlion1
Copy link
Author

mtnlion1 commented May 23, 2024 via email

@jotamartos
Copy link
Collaborator

Could you please provide more information about the changes you applied and how to reproduce the error you were running into?

@mtnlion1
Copy link
Author

mtnlion1 commented May 24, 2024 via email

@jotamartos
Copy link
Collaborator

You are right @mtnlion1, daemon is in the cron.deny file but you didn't follow our documentation to configure the cron job, right?

https://docs.bitnami.com/general/apps/wordpress/configuration/disable-wordpress-cron/

If you run the command in the command line, you can see that it's executed without problems

bitnami@ip-172-31-86-118:~$ sudo su daemon -s /bin/sh -c "whoami"
daemon
bitnami@ip-172-31-86-118:~$ sudo su daemon -s /bin/sh -c "cd /opt/bitnami/wordpress; /opt/bitnami/php/bin/php -q wp-cron.php"
PHP Warning:  Undefined array key "HTTP_HOST" in /bitnami/wordpress/wp-config.php on line 100
PHP Warning:  Undefined array key "HTTP_HOST" in /bitnami/wordpress/wp-config.php on line 101

@mtnlion1
Copy link
Author

mtnlion1 commented May 27, 2024 via email

@jotamartos
Copy link
Collaborator

  1. You are having daemon execute as root. The problem with that is that most wp cron jobs are for plugins which are not certified to be safe. It’s far better to execute as daemon without the “su”.

You are using sudo to execute a command as daemon. This is not a security issue because the command is executed as daemon.

@mtnlion1
Copy link
Author

mtnlion1 commented May 28, 2024 via email

@jotamartos
Copy link
Collaborator

It's a good security practice not to allow users like daemon run cron jobs. This way, you need admin privileges (using sudo) to run it. If that's a problem for you, you can always edit the cron.deny file and remove the user from there.

Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Jun 14, 2024
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed wordpress
Projects
None yet
Development

No branches or pull requests

4 participants