partkeepr / PartKeepr

Open Source Inventory Management
http://www.partkeepr.org
GNU General Public License v3.0
1.37k stars 398 forks source link

Edit Projects view - Critical error #845

Open RiccardoRics opened 7 years ago

RiccardoRics commented 7 years ago

System Information

Eveything setup into an El Capitan OSX laptop.

System screenshot: https://ibb.co/gi6Fi5

How to reproduce

When I click the button "Projects" in the "Edit List", then I expect the "Projects" window to be opened. Instead, I receive an error on a pup-up window. This happens always on Projects list request. The same error message (with different system_notices?_dc= value) appears, sometimes on login and on system info window request too. EDIT: It happens only after i get for the first time, the described error through the Projects list request. Checked the MySQL ProjectPart table too, and i've seen that until a certain point, the records have the remarks field value set as NOT NULL, then all the others are set as NULL.

If it helps, this problem started after i did update all the parts data using the Octopart API. Sometimes i saw that Octopart imported that to the part description field, some weird symbols instead of standard characters.

Request: GET http://localhost/~name/partkeepr/web/api/system_notices?_dc=1493625306153 Response: undefined

Full report: Critical Error

Details

The server returned a response which we were not able to interpret.

Request

GET http://localhost/~name/partkeepr/web/api/system_notices?_dc=1493625306153

Response Status Code

0

Response

undefined

Server Configuration

doctrine_orm_version: 2.5.4 doctrine_dbal_version: 2.5.2 doctrine_common_version: 2.6.0-DEV php_version: 5.6.30 auto_start_session: true maxUploadSize: 2097152 isOctoPartAvailable: true availableImageFormats: JPG,GIF,PNG max_users: unlimited authentication_provider: PartKeepr.Auth.HTTPBasicAuthenticationProvider tip_of_the_day_uri: https://partkeepr.org/tips/%s password_change: true

partkeepr.log

[2017-05-01 09:00:23] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\ConnectionException: "An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory" at /Users/name/Sites/partkeepr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 103 {"exception":"[object] (Doctrine\DBAL\Exception\ConnectionException(code: 0): An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory at /Users/name/Sites/partkeepr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:103, Doctrine\DBAL\Driver\PDOException(code: 2002): SQLSTATE[HY000] [2002] No such file or directory at /Users/name/Sites/partkeepr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:47, PDOException(code: 2002): SQLSTATE[HY000] [2002] No such file or directory at /Users/name/Sites/partkeepr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43)"} []

Drachenkaetzchen commented 7 years ago

This doesn't look like a PartKeepr issue. The error log states: "No such file or directory". This typically occurs when trying to connect to MySQL via socket where the socket file does not exist.

It's odd that it only occurs sometimes - can you check your MySQL server logs if there's a problem?

rattlelv commented 7 years ago

Latching on to this because I'm also getting the same error on Edit->Projects and View->Project Reports, except my partkeepr.log says [2017-06-11 21:40:38] ldap_driver.ERROR: 0x51 (Can't contact LDAP server): ldap://127.0.0.1 [] [] [2017-06-11 21:40:38] app.WARNING: Bad credentials. [] []

I cloned the current git repository and updated my existing install with it and ran composer update, that's when this started. tried clearing symphony cache, also the client side and that did not help.

Drachenkaetzchen commented 7 years ago

@rattlelv do you have the PHP ldap module installed?

rattlelv commented 7 years ago

according to apt-get, php5-ldap is already the newest version.

Drachenkaetzchen commented 7 years ago

Can you double-check if you have some LDAP configuration in your parameters.php file?

If it looks like this it should be okay:

$container->setParameter('fr3d_ldap.driver.accountCanonicalForm', NULL);
$container->setParameter('fr3d_ldap.driver.accountDomainName', NULL);
$container->setParameter('fr3d_ldap.driver.accountDomainNameShort', NULL);
$container->setParameter('fr3d_ldap.driver.accountFilterFormat', NULL);
$container->setParameter('fr3d_ldap.driver.baseDn', '');
$container->setParameter('fr3d_ldap.driver.bindRequiresDn', false);
$container->setParameter('fr3d_ldap.driver.host', '127.0.0.1');
$container->setParameter('fr3d_ldap.driver.optReferrals', NULL);
$container->setParameter('fr3d_ldap.driver.password', NULL);
$container->setParameter('fr3d_ldap.driver.port', NULL);
$container->setParameter('fr3d_ldap.driver.useSsl', NULL);
$container->setParameter('fr3d_ldap.driver.useStartTls', NULL);
$container->setParameter('fr3d_ldap.driver.username', NULL);
$container->setParameter('fr3d_ldap.user.attribute.email', 'email');
$container->setParameter('fr3d_ldap.user.attribute.name', NULL);
$container->setParameter('fr3d_ldap.user.attribute.username', 'samaccountname');
$container->setParameter('fr3d_ldap.user.baseDn', 'dc=blabla,dc=com');
$container->setParameter('fr3d_ldap.user.enabled', false);
$container->setParameter('fr3d_ldap.user.filter', NULL);
Drachenkaetzchen commented 7 years ago

The odd thing is that I can't see why projects behave differently than all other facilities of PartKeepr.

Drachenkaetzchen commented 7 years ago

So as there are now two users having the same issue, maybe there's something wrong with the used browsers?

Which ones are you using?

rattlelv commented 7 years ago

yes, this is what I have in there. weirder still, this error only happens when I run partkeepr from my laptop. when I run it from the desktop (same browser, firefox), I do not get it! odder yet, right after the git clone, the client-side error I was getting was 500, with the same LDAP error in the log. After fiddling with composer and cache I managed to get to error "0" instead of 500 but cannot seem to get rid of completely...

Regarding browsers, this was my first thought as well because I'm using opera on the laptop. However, I installed the same firefox on the laptop and it still throws the same error, whereas on the dekstop any browser, even Internet Explorer is opening the projects just fine. there is no firewall/antivirus except microsoft's default installed on either machine

rattlelv commented 7 years ago

I managed to narrow down the issue and repeat it. It seems the reason is some sort of timeout while loading projects. I have over 30 projects and they take a very long time to show up in the list. They do have quite a few attachments. The desktop manages to load them but the laptop craps out. When I then enter a filter in the project view to select a subset of projects then everything works as expected. What could this be? To me this looks like a client-side script timeout bug. I tried to recreate it in the demo but creating projects just takes too much time. maybe with a database insert it would be possible.

zhanglongqi commented 6 years ago

The error also shows on my server. It almost shows on every click on windows and fewer on linux.