Jump to content


Photo

Install issue (ownedsecurableitem table missing) and super user password field in plain text


  • Please log in to reply
20 replies to this topic

#1 lucas.corbeaux

lucas.corbeaux

    Newbie

  • Members
  • Pip
  • 8 posts
  • LocationAngers - France

Posted 08 July 2012 - 10:17 AM

Hi Zurmo community,

As I tried to install Zurmo on a virtualized Ubuntu 12.04, I encountered an issue in the "run installation" step.

I have the following warning that blocks the install :
Invalid argument supplied for foreach()
/home/xxx/zurmo/app/protected/modules/zurmo/utils/ReadPermissionsOptimizationUtil.php(911)

I investigated a bit, and it seems that the following query returns an error :
$sql = "select securableitem_id
						 from   ownedsecurableitem
						 where  owner__user_id = $userId";

And in fact, the ownedsecurableitem doesn't exists in my database after running the install script. Here is the list of tables created by the installation process :


_group
_group__user
_right
_user
address
auditevent
basecustomfield
currency
customfield
customfielddata
customfieldsmodel
email
emailbox
emailfolder
item
ownedcustomfield
permitable
person
policy
role

Any clue of what happened ?

I also have a suggestion : in the settings form, the Super User password field is a text field instead of password, here is a really simple patch that "fix" it. Sorry for the .txt extension, I'm not allowed to post .patch files.

Attached Files



#2 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 08 July 2012 - 07:46 PM

Which version of the application are you using? Also can you paste the query error you are seeing? Maybe it is complaining that the table is missing but I would like to confirm. Another thing to help is if you run the unit tests locally, hopefully it will help us identify more about this problem.

Jason Green
Zurmo Team
Need support? Upgrade now


#3 speixoto

speixoto

    Advanced Member

  • Members
  • PipPipPip
  • 55 posts

Posted 08 July 2012 - 10:34 PM

I got the same error using ubuntu 12.04 and using a fresh cloned version from the zurmo/zurmo repository. Runing unit tests localy i get:

"PHP Warning: Invalid argument supplied for foreach() in /var/www/zurmo/app/protected/modules/zurmo/utils/ReadPermissionsOptimizationUtil.php on line 911"

Ill attach a print screen from the Instalation error page i get.

Attached Files



#4 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 09 July 2012 - 12:56 AM

Ok. We will need to investigate this further. I know we made a change to something with the installation recently, but all tests pass for us in our server configs so not sure why this is happening.

Jason Green
Zurmo Team
Need support? Upgrade now


#5 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 09 July 2012 - 01:03 AM

Did both you guys use the virtualized image we have available for download?

Jason Green
Zurmo Team
Need support? Upgrade now


#6 Ivica

Ivica

    Advanced Member

  • Moderators
  • 478 posts

Posted 09 July 2012 - 05:45 AM

I am checking this issue, but I need to know which version of PHP is used on your servers?

#7 Ivica

Ivica

    Advanced Member

  • Moderators
  • 478 posts

Posted 09 July 2012 - 06:00 AM

Can you update your code to previou s stable version, for example 0.6.80, and try to run installation again? Version that you try to install pass all out unit tests, and works on our computers, so we need your help to find and fix this issue.
You can use command:
hg update 71b23244411c
and try to install application again.
And please inform me which PHP version is installed on your server.

I got the same error using ubuntu 12.04 and using a fresh cloned version from the zurmo/zurmo repository. Runing unit tests localy i get:

"PHP Warning: Invalid argument supplied for foreach() in /var/www/zurmo/app/protected/modules/zurmo/utils/ReadPermissionsOptimizationUtil.php on line 911"

Ill attach a print screen from the Instalation error page i get.



#8 speixoto

speixoto

    Advanced Member

  • Members
  • PipPipPip
  • 55 posts

Posted 09 July 2012 - 06:46 AM

I got the same problem with the stable version.

I'll attach two more files (phpinfo and unit tests resutl).

Attached Files



#9 Ivica

Ivica

    Advanced Member

  • Moderators
  • 478 posts

Posted 09 July 2012 - 08:36 AM

But have you tried previous stable version: 0.6.80(changeset 71b23244411c). This is important for me to know, so I can know when this issue started to happen.

Your PHP settings look fine.

I got the same problem with the stable version.

I'll attach two more files (phpinfo and unit tests resutl).



#10 speixoto

speixoto

    Advanced Member

  • Members
  • PipPipPip
  • 55 posts

Posted 09 July 2012 - 09:38 AM

But have you tried previous stable version: 0.6.80(changeset 71b23244411c). This is important for me to know, so I can know when this issue started to happen.

Your PHP settings look fine.

Yes, i tried that stable version (0.6.80).

#11 Ivica

Ivica

    Advanced Member

  • Moderators
  • 478 posts

Posted 09 July 2012 - 02:33 PM

Can you try to run tests with unfrozen database:
phpunit TestSuite.php All --no-freeze

About your tests that fails, you need to setup email test email accounts, and testApiUrl in perInstanceTest.php file, and many of those tests that fails should pass.

#12 lucas.corbeaux

lucas.corbeaux

    Newbie

  • Members
  • Pip
  • 8 posts
  • LocationAngers - France

Posted 09 July 2012 - 08:44 PM

Hi there, thanks for your replies.

Which version of the application are you using? Also can you paste the query error you are seeing? Maybe it is complaining that the table is missing but I would like to confirm. Another thing to help is if you run the unit tests locally, hopefully it will help us identify more about this problem.


I cloned the last version of Zurmo, and I tried the last stable too with the same results. I don't see query error during installation, only when I try to execute the query into my mysql client (in the same database). I tried to trace the RedBean error message right after the query that returns null, using R::$adapter->getErrorMsg(), but the error message seems to be empty. And yes, I run unit tests locally.

Can you try to run tests with unfrozen database:
phpunit TestSuite.php All --no-freeze


I tried to launch only install module tests :
phpunit TestSuite.php install --no-freeze

There is 4 errors :

1) AutoBuildDatabaseTest::testAutoBuildDatabase
Invalid argument supplied for foreach()

2) InstallUtilTest::testRunInstallation
Invalid argument supplied for foreach()

3) InstallUtilTest::testRunInstallationWithoutMemCacheOn
Invalid argument supplied for foreach()

4) InstallWalkthroughTest::testAllActions
Invalid argument supplied for foreach()


It seems to be a very environment specific problem (I don't remember such behavior in my Mac OS X), I'll try to take a deeper look tomorrow.

#13 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 10 July 2012 - 12:07 AM

Hi there, thanks for your replies.



I cloned the last version of Zurmo, and I tried the last stable too with the same results. I don't see query error during installation, only when I try to execute the query into my mysql client (in the same database). I tried to trace the RedBean error message right after the query that returns null, using R::$adapter->getErrorMsg(), but the error message seems to be empty. And yes, I run unit tests locally.



I tried to launch only install module tests :

phpunit TestSuite.php install --no-freeze

There is 4 errors :


It seems to be a very environment specific problem (I don't remember such behavior in my Mac OS X), I'll try to take a deeper look tomorrow.

We narrowed it down with the help of
speixoto

We think it is related to R::getCol not returning an array when empty in your environment, but returning Null. Maybe you can figure out why

Jason Green
Zurmo Team
Need support? Upgrade now


#14 lucas.corbeaux

lucas.corbeaux

    Newbie

  • Members
  • Pip
  • 8 posts
  • LocationAngers - France

Posted 10 July 2012 - 08:38 AM

Ok I think I got it... I wasn't using the right RedBean version, and in this case the ownedsecurableitem table were never created. I probably downloaded the v1.3.2L instead of v1.3.2, but I can't figure out how this happens, as I already installed Zurmo 3 or 4 times... Replaced with the good one, everything is ok now (install process and install unit tests), sorry for the beginner mistake !

#15 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 10 July 2012 - 01:40 PM

Ok I think I got it... I wasn't using the right RedBean version, and in this case the ownedsecurableitem table were never created. I probably downloaded the v1.3.2L instead of v1.3.2, but I can't figure out how this happens, as I already installed Zurmo 3 or 4 times... Replaced with the good one, everything is ok now (install process and install unit tests), sorry for the beginner mistake !

Glad you figured it out. The installation let you complete with the wrong version?

Jason Green
Zurmo Team
Need support? Upgrade now


#16 lucas.corbeaux

lucas.corbeaux

    Newbie

  • Members
  • Pip
  • 8 posts
  • LocationAngers - France

Posted 10 July 2012 - 06:26 PM

Glad you figured it out. The installation let you complete with the wrong version?


No, the installation failed after the settings step, the warning on ReadPermissionsOptimizationUtil.php stopped the process.

#17 speixoto

speixoto

    Advanced Member

  • Members
  • PipPipPip
  • 55 posts

Posted 10 July 2012 - 08:09 PM

Can you try to run tests with unfrozen database:
phpunit TestSuite.php All --no-freeze

About your tests that fails, you need to setup email test email accounts, and testApiUrl in perInstanceTest.php file, and many of those tests that fails should pass.


What info should i put in $emailTestAccounts? Whats the diference between userSmtpSettings and smtpSettings? IsdropboxImapSettings the settings for DropBox account?

And, how should i make perInstanceTest.php not changeble when i run unit tests again?

#18 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 10 July 2012 - 08:09 PM


No, the installation failed after the settings step, the warning on ReadPermissionsOptimizationUtil.php stopped the process.

Well it should have failed in the system check screen. We will have to work to get that fixed.

Jason Green
Zurmo Team
Need support? Upgrade now


#19 lucas.corbeaux

lucas.corbeaux

    Newbie

  • Members
  • Pip
  • 8 posts
  • LocationAngers - France

Posted 11 July 2012 - 12:27 PM

Well it should have failed in the system check screen. We will have to work to get that fixed.


I'm not sure that will be so easy, as my wrong rb.php file had the same version number : getVersion returns "1.3" for both files. As we need to manually patch the file during install, using a checksum to ensure the rb.php is OK might be difficult too.

#20 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 11 July 2012 - 11:34 PM


I'm not sure that will be so easy, as my wrong rb.php file had the same version number : getVersion returns "1.3" for both files. As we need to manually patch the file during install, using a checksum to ensure the rb.php is OK might be difficult too.


speixoto made a pull request, i have to pull in. https://bitbucket.or...on-132l-file-is It is interesting how he did it.

Jason Green
Zurmo Team
Need support? Upgrade now





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users