[ixpmanager] install n00b

Randy Bush randy at psg.com
Fri Oct 18 12:12:32 IST 2013


> a) copy and hack the fixtures.php file to add in another user;

but i can not rerun it.  it is not idempotent

ixp-manager.rg.net:/usr/local/ixp/bin# sudo -u www-data ./fixtures.php
Installing fixtures
PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'bnix' for key 'UNIQ_997B25A64082763'' in /usr/share/php/Doctrine/DBAL/Statement.php:138
Stack trace:
#0 /usr/share/php/Doctrine/DBAL/Statement.php(138): PDOStatement->execute(NULL)
#1 /usr/share/php/Doctrine/ORM/Persisters/BasicEntityPersister.php(277): Doctrine\DBAL\Statement->execute()
#2 /usr/share/php/Doctrine/ORM/UnitOfWork.php(920): Doctrine\ORM\Persisters\BasicEntityPersister->executeInserts()
#3 /usr/share/php/Doctrine/ORM/UnitOfWork.php(311): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#4 /usr/share/php/Doctrine/ORM/EntityManager.php(355): Doctrine\ORM\UnitOfWork->commit(NULL)
#5 /usr/local/ixp/bin/fixtures.php(214): Doctrine\ORM\EntityManager->flush()
#6 {main}

Next exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'INSERT INTO cust (name, type, shortname, abbreviatedName, autsys, maxprefixes, peering in /usr/share/php/Doctrine/DBAL/DBALException.php on line 47

> b) if you've forgettong the username, use MySQL: "SELECT * FROM user;"

yup, but ....

> e) sledgehammer approach: reset the database:
> 
> cd /path/to/ixp-manager
> ./bin/doctrine2-cli.php orm:schema-tool:drop --force
> ./bin/doctrine2-cli.php orm:schema-tool:create
> mysql -u username -ppassword [dbname] < tools/sql/views.sql
> ./bin/fixtures.php

i may try this next

randy



More information about the ixpmanager mailing list