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

checkUserIsSuperUser aborting archive.sh #1699

Closed
anonymous-matomo-user opened this issue Sep 14, 2010 · 11 comments
Closed

checkUserIsSuperUser aborting archive.sh #1699

anonymous-matomo-user opened this issue Sep 14, 2010 · 11 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@anonymous-matomo-user
Copy link

Initial Ticket was closed without chance to correct initial report.

The last two errors from the referenced bug report were just other examples of issues that were showing up. I know we can change the script and the user which is needed to work. However even after bash is installed and the script is run as root using bash there is still the initial error from the previous bug report when running the script.

Error:
Using /usr/local/bin/bash misc/cron/archive.sh
""
Starting Piwik reports archiving...
Reports archiving finished. Starting Scheduled tasks...
Error: You can't access this resource as it requires a 'superuser' access.Finished Scheduled tasks.""

It is not running any reports at all. There are about 12 websites in there. Its just throwing errors about access. Is there a cause for this that I am missing?

@robocoder
Copy link
Contributor

Sorry, looks like I jumped the gun.

I can't reproduce the initial error. In core/Access.php's checkUserIsSuperUser(), can you replace the method with this ... maybe it'll tell us where the privilege check is occurring.

        public function checkUserIsSuperUser()
        {
                if(!$this->isSuperUser())
                {
                        debug_print_backtrace();
                        throw new Piwik_Access_NoAccessException(Piwik_TranslateException('General_ExceptionPrivilege', array("'superuser'")));
                }
        }

@anonymous-matomo-user
Copy link
Author

I changed the code to match and here is the output.

Using sh it is throwing this message:

sh misc/cron/archive.sh
Starting Piwik reports archiving...

Reports archiving finished.
Starting Scheduled tasks...

#0 Piwik_Access->checkUserIsSuperUser() called at [/usr/local/www/piwik/core/Piwik.php:1233]
#1 Piwik::checkUserIsSuperUser() called at [/usr/local/www/piwik/plugins/CoreAdminHome/API.php:36]
#2 Piwik_CoreAdminHome_API->runScheduledTasks()
#3 call_user_func_array(Array ([=> Piwik_CoreAdminHome_API Object (),1 => runScheduledTasks), Array ()) called at [/usr/local/www/piwik/core/API/Proxy.php:151]
#4 Piwik_API_Proxy->call(Piwik_CoreAdminHome_API, runScheduledTasks, Array ([=> 7a9205a66ed1cb755f1b52356ebdc352,-- => ,[=> API,method => CoreAdminHome.runScheduledTasks,[=> csv,convertToUnicode => 0,[=> 50)) called at /usr/local/www/piwik/core/API/Request.php:117
#5 Piwik_API_Request->process() called at [/usr/local/www/piwik/plugins/API/Controller.php:27]
#6 Piwik_API_Controller->index()
#7 call_user_func_array(Array ([=> Piwik_API_Controller Object ( => API,[=> , => ,[=> 0, => ),[=> index), Array ()) called at /usr/local/www/piwik/core/FrontController.php:126
#8 Piwik_FrontController->dispatch() called at [/usr/local/www/piwik/index.php:60]
Error: You can't access this resource as it requires a 'superuser' access.Finished Scheduled tasks.

If I use bash -e then it shows this:

bash -e misc/cron/archive.sh
Starting Piwik reports archiving...

Nothing is updated in either case. Very odd. I apologize for the hassle, but this is driving me crazy. :)

Would it be better to attach the output in a separate file?

@anonymous-matomo-user
Copy link
Author

Attachment: Piwik output on archive.sh run
piwik output.txt

@anonymous-matomo-user
Copy link
Author

I'm not sure why this is, but the token auth as showing in the above output (7a9205a66ed1cb755f1b52356ebdc352) does not match the token assigned to any user in the system. That exact string does not exist in the database at all.

@anonymous-matomo-user
Copy link
Author

Well, at the risk of sounding like a idiot I think I figured out the problem. This install is from .04 or 5 that has been continuously upgraded. I noticed on a clean install that it does not allow for spaces in the administrator user name.

I edited the config.ini.php to remove the space from my admin login name on my old install and the script now works as expected.

I can't imagine nobody else has run into this. I must have missed the memo.

Thank you for your help

@mattab
Copy link
Member

mattab commented Sep 14, 2010

Someone ran into this issue before which is we now forbid spaces in passord. However we didn't deal with existing SU passords containing spaces (as you were probably only 2 users affected by this..)

@anonymous-matomo-user
Copy link
Author

In my case it was a space in the user name not the password. In any case, I'm confirming it fixed by removing the space from my user name.

@robocoder
Copy link
Contributor

(In [3154]) fixes #1699 - add an update warning if superuser login is no longer a valid format

@mattab
Copy link
Member

mattab commented Sep 19, 2010

vipsoft, I thought the issue was also with the SU password containing spaces? The patch deals with username only. thanks:)

@robocoder
Copy link
Contributor

matt: even if so, there's no way to determine that since we only save a hash

@mattab
Copy link
Member

mattab commented Nov 16, 2010

indeed, thanks for following up

@anonymous-matomo-user anonymous-matomo-user added this to the Piwik 1.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants