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

PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'stockLevel' cannot be null' #392

Closed
staze opened this issue Mar 6, 2015 · 5 comments
Labels
Milestone

Comments

@staze
Copy link

staze commented Mar 6, 2015

Seeing an error when UpdatePartCacheData.php runs where it's claiming there is a stockLevel that's null. From looking through the DB, I don't see what it's talking about. =/

Any thoughts on where I could look to figure out what it's talking about?

The full error message is:

PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'stockLevel' cannot be null' in /usr/local/php5-5.6.6-20150220-223817/lib/php/Doctrine/DBAL/Connection.php:784
Stack trace:
#0 /usr/local/php5-5.6.6-20150220-223817/lib/php/Doctrine/DBAL/Connection.php(784): PDOStatement->execute()
#1 /usr/local/php5-5.6.6-20150220-223817/lib/php/Doctrine/ORM/Persisters/BasicEntityPersister.php(447): Doctrine\DBAL\Connection->executeUpdate('UPDATE Part SET...', Array, Array)
#2 /usr/local/php5-5.6.6-20150220-223817/lib/php/Doctrine/ORM/Persisters/BasicEntityPersister.php(357): Doctrine\ORM\Persisters\BasicEntityPersister->_updateTable(Object(PartKeepr\Part\Part), 'Part', Array, NULL)
#3 /usr/local/php5-5.6.6-20150220-223817/lib/php/Doctrine/ORM/UnitOfWork.php(984): Doctrine\ORM\Persisters\BasicEntityPersister->update(Object(PartKeepr\Part\Part))
#4 /usr/local/php5-5.6.6-20150220-223817/lib/php/Doctrine/ORM/UnitOfWork.php(317): Doctrine\ORM\UnitOfWork->executeUpdates(Ob in /usr/local/php5-5.6.6-20150220-223817/lib/php/Doctrine/DBAL/DBALException.php on line 47

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@hardwic
Copy link

hardwic commented Mar 14, 2015

This happens if you add a part but don't enter a value or forget to tick the per item box.
Just find the parts with no stock history and add 1 comp with a value and then remove it.

@staze
Copy link
Author

staze commented Mar 16, 2015

Okay, I just finished doing this. Interestingly, for those parts, "add stock" treated things like having null stock to start with (so a part that showed as having 10 pieces, adding 2 resulted in 2 total). We'll see if the error re-occurs next Cron run.

Thanks!

@staze
Copy link
Author

staze commented Mar 16, 2015

That seems to have worked. I thought it didn't, but then managed to find one item I missed adding stock to.

Cool, thanks!

@staze staze closed this as completed Mar 16, 2015
@Drachenkaetzchen
Copy link
Member

I'm reopening this as it's a bug which should be fixed.

@Drachenkaetzchen Drachenkaetzchen added this to the 0.75 milestone Oct 16, 2015
@Drachenkaetzchen
Copy link
Member

The cronjob is not necessary anymore, thus closing.

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

No branches or pull requests

3 participants