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

Large database, codeigniter.php errors? #53

Closed
therourke opened this issue Oct 29, 2013 · 20 comments
Closed

Large database, codeigniter.php errors? #53

therourke opened this issue Oct 29, 2013 · 20 comments

Comments

@therourke
Copy link

Hi. I realise you guys are not working on the old code, but I am stuck. My database is quite large and unwieldy. I recently moved servers and cleaned up everything in the process to make sure that it was as efficient as possible, but I am still handling thousands and thousands of entries and about 20 feeds.

Adding tags is now hit and miss. 80% of the time they just do not get added to the database, and I sometimes receive errors about codeigniter.php, like this:

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_REFERER

Filename: admin/write.php

Line Number: 62

Backtrace:

File: 
*****SERVERNAME*****/machinemachine.net/stream/application/controllers/admin/write.php
Line: 62
Function: _exception_handler

File: *****SERVERNAME*****/machinemachine.net/stream/index.php
Line: 251
Function: require_once

Mostly though the process just times out when trying to add a list of tags.

I'd be really appreciative if you could give me some advice on this. It's starting to make my lifestream close to useless.

Cheers

Daniel

@MitchellMcKenna
Copy link
Owner

Referer is used to know where to send you after you save a post. If the referer (aka the page you came from before the save post page) isn't passed in the POST data from saving the post, it uses the SERVER variable for the referer. Looks like your new hosting service doesn't provide that for you to use. I'd like to get a way from counting on that anyway.

Change line 62 to send you back to the admin dashboard after saving, so change:
$data->referer = '$_SERVER['HTTP_REFERER'];
to
$data->referer = '/admin';

@therourke
Copy link
Author

Hmmm. I changed that code, but still getting problems, and it is still going back to a 404 page at the end. I even tried changing to this: $data->referer = 'http://machinemachine.net/stream/admin'; to be absolutely specific, but no luck there either

@MitchellMcKenna
Copy link
Owner

Can you post the errors?

@therourke
Copy link
Author

It's not showing any errors, just the 404 and the post is not being updated

@MitchellMcKenna
Copy link
Owner

Can you open up chrome console and try saving the post again, see if you see a POST being made with the data your saving and a 302 redirect:

dashboard__lifepress_admin_panel

@therourke
Copy link
Author

Hmmm, you mean like this? Seems like there are problems with the MarkDown scripts.

@MitchellMcKenna
Copy link
Owner

Look under the "Network Tab" for what I posted above.

Those scripts are missing, but it's just JS, so it's not the cause of hte problem, you can fix that by making sure this pagedown folder/files are present inside the /public/scripts/ folder: https://github.com/MitchellMcKenna/LifePress/tree/master/public/scripts

@therourke
Copy link
Author

The scripts are in place, but I am still getting those errors. Here's a screenshot of the network tab.

Still no success in getting this to save. Times out after 2 mins

55 requests  ❘  57.0 KB transferred  ❘  2.1 min (load: 2.1 min, DOMContentLoaded: 2.1 min)
10542
/stream/admin/write/edit
POST 404 Not Found text/html Other 42.8 KB 114 KB 2.1 min 2.1 min

@therourke
Copy link
Author

I notice in the above screenshot that the /stream/ suffix is missing from the markdown script url. My installation is in a folder on my website, so in the config.php file I have it like this:

$config['base_url'] = 'http://machinemachine.net/stream/';

Is this causing the problem somewhere perhaps? Or is there a base_url called incorrectly somewhere?

@MitchellMcKenna
Copy link
Owner

Nice catch, there was an issue where the Pagedown js wouldn't get included if you had LifePress in a subfolder, I just pushed up a fix for this to the develop branch.

However this won't solve the saving issue you're having. I tossed Lifepress in a subfolder called /stream/ as well and was unable to reproduce the saving issue.

In that screenshot you posted, the one I want to see is the one right at the bottom where METHOD = POST. If you can see what the response is from that call by clicking it and posting that, that would be great. However it says PENDING, so the call might be hanging for some reason.

@therourke
Copy link
Author

Like this?

@MitchellMcKenna
Copy link
Owner

Sorry, click on the Network tab, then click on the # of the item you are editing (10542) on the left with POST beside it, and then get what it says in the "Response" tab (beside "cookies".

@therourke
Copy link
Author

OK, maybe these are what you need, finally :-)

Before 'Save Changes' / After 'Save Changes'

@MitchellMcKenna
Copy link
Owner

Hmm, that's just a 404 page, not much help. Can you do a database dump and host it somewhere (machinemachine.net or dropbox) and email me the link so I can try it on my local?

@therourke
Copy link
Author

You are a lifesaver... I sent you the dropbox link

@therourke
Copy link
Author

Hi Mitchell. Have you had a chance to look over this by any chance? Thanks

@MitchellMcKenna
Copy link
Owner

Should get a chance to take a look at it tonight or this weekend.

@therourke
Copy link
Author

Thanks Mitchell. Really appreciated. I haven't been able to tag any new
items for weeks.

MitchellMcKenna added a commit that referenced this issue Nov 11, 2013
- Running clean_tags() after every save/edit of a post can cause a high
  load because it causes a lot of queries and can cause php to 500 from
  running out of memory.

Refs #53 #49
@MitchellMcKenna
Copy link
Owner

@therourke Thanks for your patience. Turns out the issue you were running into is the same issue I ran into on godaddy hosting where the cleaning up of tags was so expensive (because there's so many tags in your LifePress) that it causes it to reach the php memory limit and 500 (issue #49). For this reason I have disabled clean_tags() for now, tag counts will be a little off because of it but that's not a big issue. I have pushed up the fix to the 'develop' branch.

@therourke
Copy link
Author

That's done it! Thankyou. My unwieldy database strikes again. Looking forward to adding tags again. Many thanks

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

No branches or pull requests

2 participants