Menu

#376 Some Errors during upgrade from 1.1 to 1.2

1.1
open
nobody
None
1
2016-02-23
2016-02-01
Anonymous
No

Hi Miha, thank you for the new version. I tried it and came to some issues while upgrading from 1.1.

Environment
php 5.5.3
mysql 5.6
Web Server IIS on Windows 2008 R2 x64

1st Error
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'state' at row 2Failed query:

/* change tag */
ALTER TABLE `ipaddresses` CHANGE `state` `state` INT(3)  NULL  DEFAULT '1';

After clicking "Go to administration and fix" can start again upgrade process

Then 2nd error:

SQLSTATE[01000]: Warning: 1265 Data truncated for column 'wsize' at row 1Failed query:
/* add new widgets */
INSERT INTO `widgets` (`wtitle`, `wdescription`, `wfile`, `wparams`, `whref`, `wsize`, `wadminonly`, `wactive`)
VALUES
    ('Tools menu', 'Shows quick access to tools menu', 'tools', NULL, 'yes', '6', 'no', 'yes'),
    ('IP Calculator', 'Shows IP calculator as widget', 'ipcalc', NULL, 'yes', '6', 'no', 'yes');

Again "Go to administration... and upgrade process

3rd error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'app_security' in 'api'Failed query:

/* add 'user' to app_security set */
ALTER TABLE `api` CHANGE `app_security` `app_security` SET('crypt','ssl','user','none')  NOT NULL  DEFAULT 'ssl';

Again "Go to administration..." after that I'm logged in in phpipam

Error Database Verification
Missing tables:

firewallZoneSubnet

Fixing it.
Seems everything working fine but while editing users there are comming strange errors and looking at subnets also seems not everything to be ok

10.3.0.0/24 VMnet 3 / / 13 167968768 24 4 0 0 Yes 0 No 0 {"3":"1","2":"2"} Yes 0 No 0 No 1 No No 2 2016-02-01 14:13:24

Discussion

  • Anonymous

    Anonymous - 2016-02-01

    Ok regarding the first error, I used the workaround from the Ticket 178
    http://sourceforge.net/p/phpipam/support-requests/178/
    that seemed also to work in my case. The Upgrade process worked flawlessly and no other errors.

    Regarding the strange view, that seems to persist and the case is probably that all custom fields of subnet, user, ip address, vlan etc. are set with visibility to "yes" - so why all changed to be visible and how can I return to the original visibility.

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-02-02

    Can you give screenshot, I am not sure what you mean by strange view.

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-02-02

    Aha. This is related to line breaks in windows. There was a thread on that on GH. Will check.

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-02-02

    Hm.. This is the thread from GitHub:
    https://github.com/phpipam/phpipam/issues/223

    Not sure how to do it manually... Maybe open db/SCHEMA.SQL with some editor and change line endings to LF?

     
  • Anonymous

    Anonymous - 2016-02-02

    Hm.. doesn't seem to be the problem. schema.sql has already LF Endings. I found 10 other .php files with CRLF endings and changed them to LF but that didn't help either.

    If you could see on the screenshots, all fields are displayed as "Custom Fields" and the Visibility of them ist set to "yes" maybe this is right path we should look into.

    Additionaly when I go to "Filter IP Fields" there are no results but only error
    Warning: Invalid argument supplied for foreach() in C:\inetpub\phpipam\app\admin\filter-fields\index.php on line 44

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-02-02

    Standard fields are detected from SCHEMA.sql , custom fields take all fields in DB and removes SCHEMA.sql fields (standard).

    Since it cannot parse SCHEMA.sql it treats all fields (custom+standard) as custom and displays them.

    Tryo to play with functions/classes/class.Tools.php, method fetch_standard_fields (on line 1005). I have a feeling problem is on line 1012 or line 1015:

    $definition = trim(strstr($definition, ";\n", true));
    $definition = explode(PHP_EOL, $definition);

    Try changing this to \r\n, or replace PHP_EOL with "\r\n". Cannot do anty tests as I do not use windows.

     
  • Anonymous

    Anonymous - 2016-02-02

    Thank you very much for your help and suggestions. After playing with different settings I found the one which is working. Changed
    $definition = explode(PHP_EOL, $definition);
    to
    $definition = explode("\n", $definition);

    seems that under Windows the PHP_EOL is set to wrong Line Break Char.

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-02-02

    Which php version do you use ?

     
  • Anonymous

    Anonymous - 2016-02-23

    Hello Miha,
    thank you for this awesome tool. I'm writing because I have a problem during the update to 1.2. As someone stated before, I get an error about a table:

    Database error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'phpipam.firewallZoneSubnet' doesn't exist

    I tried to fix but the error always come up. I also tried to manually run the SQL script but I get this error:

    1005 - Can't create table 'phpipam.firewallZoneSubnet' (errno: 150)

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.