opennetworkinglab / flowvisor

FlowVisor - A network hypervisor
Other
164 stars 67 forks source link

Problems after upgrade with old configuration #268

Open CarolinaFernandez opened 11 years ago

CarolinaFernandez commented 11 years ago

After performing an upgrade from 0.8.1 to 1.4.0-1 I have been facing several problems. Similar errors happened later when trying a downgrade to 1.0.0-1.

Here I detail all the steps followed for the upgrade. Step no. 5 is the conflictive one. Attached there is one of the hundreds of errors shown (along with the expected shrinking to 45 characters).

I could live with the latter problem, but what is happening when the slice name is shorter? Why are these error happening?

Also, note that I can see all the original slices and their flowspaces, but I cannot add or delete any slices, and probably I won't be able to perform any other writing operation as well.

Does this have something to do with permissions for the Derby database?

Followed upgrading procedure:

  1. Backup the old config.xml file
  2. sudo apt-get install flowvisor=1.4.0-1

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be upgraded:
    flowvisor
    1 upgraded, 0 newly installed, 0 to remove and 101 not upgraded.
    Need to get 7483 kB of archives.
    After this operation, 8654 kB of additional disk space will be used.
    Get:1 http://updates.onlab.us/debian/ stable/ flowvisor 1.4.0-1 [7483 kB]
    Fetched 7483 kB in 4min 29s (27.8 kB/s)                                                                                               
    (Reading database ... 38291 files and directories currently installed.)
    Preparing to replace flowvisor 0.8.1 (using .../flowvisor_1.4.0-1_all.deb) ...
    Unpacking replacement flowvisor ...
    dpkg: warning: unable to delete old directory '/usr/etc/flowvisor': Directory not empty
    dpkg: warning: unable to delete old directory '/usr/etc': Directory not empty
    Processing triggers for man-db ...
    Setting up flowvisor (1.4.0-1) ...
    
    >> Configuration file `/etc/init.d/flowvisor'
    ==> File on system created by you or by a script.
    ==> File also in package provided by package maintainer.
    What would you like to do about it ?  Your options are:
     Y or I  : install the package maintainer's version
     N or O  : keep your currently-installed version
       D     : show the differences between the versions
       Z     : start a shell to examine the situation
    The default action is to keep your current version.
    *** flowvisor (Y/I/N/O/D/Z) [default=N] ? Y
    Installing new version of config file /etc/init.d/flowvisor ...
    Please run fvconfig generate to create and initialize the database
  3. sudo -u flowvisor fvconfig generate newconfig.json

    Trying to generate SSL Server Key with passwd from scripts/envs.sh
    Generating cert with common name == ***
    Enter password for account 'fvadmin' on the flowvisor:
    Generating default config in db
    Outputing config file newconfig.json
  4. fvconfig convert config.xml
  5. sudo fvconfig load config.json Inserting rule with action on unknown slice testing_some_slice; hope you know what you are doing... java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'JFSRSLICE' caused a violation of foreign key constraint 'FLOWSPACERULE_TO_SLICE_FK' for key (-1). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source) at org.flowvisor.config.FlowSpaceImpl.insert(FlowSpaceImpl.java:919) at org.flowvisor.config.FlowSpaceImpl.fromJson(FlowSpaceImpl.java:686) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.flowvisor.config.FVConfigProxy.invoke(FVConfigProxy.java:21) at $Proxy2.fromJson(Unknown Source) at org.flowvisor.config.FVConfig.readFromFile(FVConfig.java:113) at org.flowvisor.config.LoadConfig.main(LoadConfig.java:139) Caused by: java.sql.SQLException: INSERT on table 'JFSRSLICE' caused a violation of foreign key constraint 'FLOWSPACERULE_TO_SLICE_FK' for key (-1). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 19 more Caused by: ERROR 23503: INSERT on table 'JFSRSLICE' caused a violation of foreign key constraint 'FLOWSPACERULE_TO_SLICE_FK' for key (-1). The statement has been rolled back. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.execute.ForeignKeyRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.GenericRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.RISetChecker.doFKCheck(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) ... 13 more