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

Error upgrading to 2.1.13 #228

Closed
rdoursenaud opened this issue Jan 3, 2013 · 10 comments
Closed

Error upgrading to 2.1.13 #228

rdoursenaud opened this issue Jan 3, 2013 · 10 comments

Comments

@rdoursenaud
Copy link

Upgrading from a 2.1.9, I get an error at step 4 : "An error appears when inserting datas!" and
"Misc table will be populated with new values" appears with an exclamation mark.

I've been unable to find the actual error, is there a way to trace what went wrong (a log or something)?

Any idea of what can cause this behavior (This is an install that's been updated regurlarly from the cpassman era).

Beside that, the error message should really read : "The error " . $description_of_error_here . "appeared while inserting data."

@nilsteampassnet
Copy link
Owner

In order to check what step failed, I suggest you to do as this:

  • open file install/upgrade_ajax.php (1)
  • found line => ## Populate table MISC
  • via phpmyadmin, open table "misc" and get to last entries
  • You have now to check what is the last entry in your table
  • check in (1) what is the next one that should have been inserted, because this is this one that failed.

Please come back

@owindsor
Copy link

owindsor commented Jan 3, 2013

I had a similar issue - My upgrade was failing when trying to import my SMTP details in to the MISC table.

The issue in my case was that my SMTP details in the settings.php were enclosed in single quotes -

$smtp_server = 'localhost';

Swap them out for double quotes, reload the upgrade page then launch it again and all upgraded correctly.

Cheers,

Owen

@rdoursenaud
Copy link
Author

Thanks @owindsor, that did the trick.
I think this needs to be fixed…

@nilsteampassnet
Copy link
Owner

Sure I will

Thank you for the tip ;-)

@reuvygroovy
Copy link

For me, my table and the file match up through these fields:
max_latest_items
enable_favourites
show_last_items
enable_pf_feature

Then, the next line in my table is the field "log_connections", but in the php file it is I guess trying to insert the field "menu_type" which is where it is failing.

Also, I also noticed that my mySQL tables are of a different field count, so for example, I am running 2.1.12, and the schema for the items table is different than of .13 from a fresh install. See attached screenshots.

13
12

@benjaminbellamy
Copy link

I had the same issue, this is a double-single-quotes issue as owindsor said.
The SQL query that fails is:
INSERT INTO teampass_misc (type, intitule, valeur) VALUES ('admin', 'email_smtp_auth', ''false'');
''false'' instead of 'false'.

@benjaminbellamy
Copy link

In install/upgrade_ajax.php, line 303, single quotes should be removed from SESSION variable values:
$res1 = mysql_query("INSERT INTO ".$_SESSION['tbl_prefix']."misc (type, intitule, valeur) VALUES ('".$elem[0]."', '".$elem[1]."', '".str_replace("'","",$elem[2])."');");

@nilsteampassnet
Copy link
Owner

Thank you for this finding!
Corrected in 2.1.14

nilsteampassnet added a commit that referenced this issue Jan 16, 2013
* list of bugs corrected: #238 - #235 - #239 - #203 - #201 - #233 - #226
- #236
#228 - #189 - #234 - #225 - #239 - #194
* Corrected bug for sending emails
* Different small corrections
@reuvygroovy
Copy link

Just had the same issue upgrading to 2.1.15, commenting these lines helped, atthough I didn't dig deeper to look which one:

// array('admin', 'log_accessed', '1',1),
// array('admin', 'default_language', 'english',0),
// array('admin', 'send_stats', empty($_SESSION['send_stats']) ? '0' : $_SESSION['send_stats'],1),
/// array('admin', 'send_mail_on_user_login', '0', 0),
// array('cron', 'sending_emails', '0', 0),
// array('admin', 'nb_items_by_query', 'auto', 0),
// array('admin', 'enable_delete_after_consultation', '0', 0),
// array('admin', 'path_to_upload_folder', strrpos($_SERVER['DOCUMENT_ROOT'],"/") == 1 ? (strlen($_SERVER['DOCUMENT_ROOT'])-1).substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF'])-25).'/upload' : $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF'])-25).'/upload', 0),
// array('admin', 'url_to_upload_folder', 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/')-8).'/upload', 0),
// array('admin', 'enable_personal_saltkey_cookie', '0', 0),
// array('admin', 'personal_saltkey_cookie_duration', '31', 0),
// array('admin', 'path_to_files_folder', strrpos($_SERVER['DOCUMENT_ROOT'],"/") == 1 ? (strlen($_SERVER['DOCUMENT_ROOT'])-1).substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF'])-25).'/files' : $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF'])-25).'/files', 0),
// array('admin', 'url_to_files_folder', 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/')-8).'/files', 0),
// array('admin', 'pwd_maximum_length','40',0),
// array('admin', 'email_smtp_server', @$_SESSION['smtp_server'], 0),
// array('admin', 'email_smtp_auth', @$_SESSION['smtp_auth'], 0),
// array('admin', 'email_auth_username', @$_SESSION['smtp_auth_username'], 0),
// array('admin', 'email_auth_pwd', @$_SESSION['smtp_auth_password'], 0),
// array('admin', 'email_post', '25', 0),
// array('admin', 'email_from', @$_SESSION['email_from'], 0),
// array('admin', 'email_from_name', @$_SESSION['email_from_name'], 0),

@reuvygroovy
Copy link

Trying again, it failed on one of these:
// array('admin', 'email_smtp_server', @$_SESSION['smtp_server'], 0),
// array('admin', 'email_smtp_auth', @$_SESSION['smtp_auth'], 0),
//array('admin', 'email_auth_username', @$_SESSION['smtp_auth_username'], 0),
//array('admin', 'email_auth_pwd', @$_SESSION['smtp_auth_password'], 0),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants