I originally thought that this was the same issue as http://drupal.org/node/300110 however the new version does not fix the problem I am having.
I am running 5.10 and was running 1.6 but am now running 1.7
Running WAMP on XP. VHOSTS seems to be set up fine, as domains resolve perfectly.
Basically whenever I try to enable the module the page hangs. And then if I stop it and try to browse around the site, all the pages are white.
I have looked under watchdog in the databse and found over a thousand entries for: <-- my guess is there will be more if I do not stop the page once it hangs.
Duplicate entry '1-0-domain_site' for key 1
query: INSERT INTO domain_access (nid, gid, realm) VALUES (1, 0, 'domain_site') in C:\Program Files\wamp\www\enj\includes\database.mysql.inc on line 172.
This would explain why it's hanging, but not why it's doing this. Im not really sure how to proceed in debugging this. Can someone point me in the right direction or let me know if I'm doing something wrong?
NOTE: This is on a local test copy of a site I have running live currently.
NOTE: This happens regardless of what modules I enable at the same time, or if I only enable domain access.
| Comment | File | Size | Author |
|---|---|---|---|
| #38 | enable.patch | 2.19 KB | agentrickard |
Comments
Comment #1
asd123asd5 commentedActually the new version fixed the fact that I get white pages after I stop it when it hangs, but it still hangs.
Comment #2
asd123asd5 commentedOk, I have tested it with a live virtuozzo running linux, still no go.
Comment #3
asd123asd5 commentedWorks on fresh install, must be a clash with a module or something else. Will continue looking into it :(
Comment #4
agentrickardMarking as needs info. Let's keep this open for a week or so, just in case.
Comment #5
fp commentedI have this problem too on an install running only the required core modules
log says:
Comment #6
fp commentedTo follow up on my previous post, I can confirm #3: I don't either get the problem on a fresh install. However, I do get it on an install with only required core modules are enabled, after disabling all other modules.
Comment #7
agentrickard@fp-
This is a simple memory limit issue. You should give Drupal at least 32MB.
Comment #8
fp commentedI know. This is using 100MB... which points to some memory leak.
Comment #9
agentrickardAre you enabling DA on a site that already has a lot of nodes (100,000 >)?
Comment #10
fp commentedNo, only a handful of nodes. I will try to reproduce the problem starting from scratch and update with my findings.
Comment #11
bribiz commentedI too am having the same problem as described above. I have installed version 1.8 and still same problem. I previously had domain access working under version 1.4 until I tried to install 1.7 and 1.8.
Did anyone find a resolution to this issue? There must be some common issue.
Comment #12
agentrickardYou site hangs during the 'update node access' process? This could actually be a JS issue.
Comment #13
bribiz commentedTried it on Google Chrome instead of Firefox. Chrome reported:
=================
This webpage is not available.
The webpage at http://www.(mydomain).com/admin/build/modules/list/confirm might be temporarily down or it may have moved permanently to a new web address.
More information on this error
Below is the original error message
Error 320 (net::ERR_INVALID_RESPONSE): Unknown error.
==================
Does error 320 relate to a JS issue? I'm not familiar with error 320.
Comment #14
bribiz commentedOkay error 320 could be a Google issue. Tried it in IE -- same problem. I then increased my max_execution_time in php.ini to 300 seconds and tried it again in Firefox. After less than 300 seconds it still died again.
Comment #15
agentrickardYou are running the update from your registered 'primary domain,' right?
Comment #16
agentrickardI read through this bug report for Chrome and it makes me wonder if this is a general problem with either a) some web server / browser combinations, or b) something that needs to be fixed in Drupal core.
Do any of the other Drupal batch processes fail?
Comment #17
bribiz commentedI don't have any other batch processes to run but I'm willing to install another module that does to try it.
I decided to test the memory leak issue. I have max_execution_time set to 300 and I upped the memory to 256M in php.ini. I then try to install domain access and I used top to watch the memory and cpu.
After about 5 minutes it died. It consumed all available memory on my 2GIG dedicated server. I saw one httpd process continue to climb to over 15% of memory. The httpd process and a mysqld process consumed about 50% of cpu each on my dual quad core system throughout the process.
It's like it's stuck in a continuous loop, a runaway query or something. It could also be some sort of config conflict issue but would the browser cause a process to continue on like this?
Comment #18
agentrickardI would refer you to #15. You did configure DA before running the node update, right?
Comment #19
agentrickardComment #20
awolfey commentedI seem to have had a similar problem using DA 1.9 on a couple of attempts to install it.
I apply the patches I need, edit the files that require editing, enable the main DA module and none of its helper modules, and Drupal hangs when I submit the module configuration page. After a couple of minutes I cancel the page load and refresh and it appears that DA is installed correctly. It works. Meanwhile, there is an apache process ongoing related to the enable of the module. When I noticed there was a problem watchdog had filled up, this time with 22 million records. I only caught it after the server gave notice that the disk was almost full.
Here's a sample error:
Duplicate entry '1-0-domain_editor' for key 1
query: INSERT INTO domain_access (nid, gid, realm) VALUES (1, 0, 'domain_editor') in /home/user/public_html/vcn/includes/database.mysql.inc on line 172.
So I disabled and uninstalled DA. Killed the bad apache process. Cleaned up watchdog. Re-enabled DA and again the module configuration hangs and the watchdog entries start piling up.
Then, trying again I just disable, I don't uninstall DA, kill the apache process filling up watchdog and empty watchdog. But this time DA renables without any problems and is working.
I have a large number of contributed modules installed. I'm willing to run some tests or provide more details if anyone has suggestions or questions.
Aaron
Comment #21
awolfey commentedSorry, reopening.
Comment #22
agentrickardThis appears to me to be an error related to the enable/disable of the module. Here's the function in question:
You appear to be getting multiple inserts for node id 1, domain id 0, realm 'domain_editor'.
This should not be happening for two reasons:
-- The insert should not run if the {domain_access} table is already populated.
-- The insert should only run once per node id.
I cannot replicate this error. My suspicions are as follows:
-- The module was disabled improperly, either directly through the database, or through another method.
-- You are running a version of MySQL or pgSQL that does not behave as expected.
Perhaps these queries are returning bad results:
Perhaps that second query needs to be different:
Comment #23
agentrickardFor the record, this is tested on:
MySQL 5.0.41
PHP 5.2.5
Comment #24
awolfey commentedI am using PHP 5.2.6 and MYSQL 5.0.51a.
The module was disabled and uninstalled through Drupal, not the database.
I have these settings in domain.module:
define('DOMAIN_INSTALL_RULE', TRUE);
define('DOMAIN_EDITOR_RULE', TRUE);
define('DOMAIN_SITE_GRANT', TRUE);
I will test again and let you know.
Comment #25
awolfey commentedI have not tried a reinstall, but looking again, it appears that I had not updated settings.php for domain_conf.inc before I enabled Domain and domain_conf (along with themes and content). Perhaps that was part of the problem.
Comment #26
agentrickardThat should not have an effect during the install process.
Comment #27
bribiz commentedOkay...I finally worked on this again and I had the same problem on a completely different site with an almost fresh install recently upgraded on a completely different system. I checked my watchdog table and it grew from 264 records to over 64,000.
I did change the second query as referenced above in post #22 and it worked. I no longer had the white screen of death. (I still need to test out the module to confirm it really works!)
But it returned to the module list with a new error. I could not find where this query comes from or if this is important. I search the code and used grep with no luck.
BTW -- PHP = 5.1.6 and mysql = 5.0.45
Hope this helps!
Thanks,
Brian
Comment #28
agentrickardSo there are two issues here.
One is that the query in #22 may fail in PHP 5.1 -- that makes little sense to me.
Two is that the module list page ran a node access query. Which also makes no sense, unless you have blocks that display nodes appearing on that page.
And what are the watchdog records?
Comment #29
bribiz commentedI believe the watchdog table is to log errors and monitor site. It is being replaced in d6. I found more info here: http://drupal.org/node/300
I believe the other person also reported the problem in PHP 5.2.6 so it may be more than just 5.1. I think some of the way PHP access databases and objects was change starting in 5.x which could be why your 2 line change worked.
As far as the other error goes, I have not encountered it since.
Comment #30
agentrickardI know what watchdog is.
What is being _written_ to watchdog?
Comment #31
agentrickardI still suspect something else, since I run PHP 5.2.5 and MySQL 5.0.41.
This is not a widespread problem, otherwise the issue queue would be full of people screaming.
Comment #32
bribiz commentedI could run it again and take a look at the watchdog records but I suspect we both have better things to do since it isn't widespread.
Today I learned that you wrote both domain_access and mysite which are very significant modules. Just wanted to say thanks for your awesome contribution and I hope I can help these projects in the future somehow.
Comment #33
agentrickardWell, I'll patch the queries as defined in #22, but still don't see the root cause.
Comment #34
4kant commentedHi,
I´m not sure whether this bases on the same cause.
I was looking for a thread concerning "memory problems" with DA.
In my case I get an endless waiting hour-glass when I click on "Save" editing a single node. No matter what I edited.
I had no problems during install of DA (on a website with drupal 5.12 with some nodes)
I noticed that the hour-glass only comes at the root Domain.
When I´m inside another domain everything (even the same node) works fine.
I still have to test - but maybe that´s already helpful for you (I´m not screaming...)
4k
Comment #35
agentrickard@4kant
That is a separate issue.
Comment #36
rohnjeynolds commentedAs far as I can tell, the issue is caused by what's described in #22.
The db_result() function returns the first value found in the database; it doesn't iterate over the result set. So $nid will always be the first the ID for the first node encountered in the nodes table, and the while() loop will never end -- hence the hang and the thousands of 'duplicate key' entries in watchdog.
Change to db_fetch_array() or db_fetch_object() and update the references to $nid inside the loop accordingly, and the module will install.
Great module, but this is one nasty bug in the 5.x version.
Comment #37
agentrickardThanks for that report. It explains what I had suspected.
Comment #38
agentrickardFor the record, I was never able to replicate this error, which may be a PHP version issue.
Committed anyway, since the fix works in all cases. Patch attached for reference.
Comment #40
mburak commentedJust to make clear that there's no a PHP version problem here. It's just the Drupal 5 version of the db_result function.
As default, row is 0, so if you don't pass this param it will always try to fech the first row in the result. This doesn't happen in Drupal 6 because the function doesn't have this default row value.
Hope this helps to understand the issue.
Comment #41
mr.j commentedYou should consider releasing a 5.x-1.10 with this fix.
I just ran into the same problem installing the module in a shared hosting environment and had the host on my back because of a 'rogue' mysql process.