Error saving config

Asked by Wes Groleau

On media tab of gedcom
Copied all entries from PGV except directory.
Wanted to share media with PGV, so copied PGV's default which is the index directory
Clicked Save and I think the media directory is _not_ the problem:
ERROR 2: file_get_contents(data/wgroleau.ged_conf.php) [function.file-get-contents]: failed to open stream: No such file or directory
0 Error occurred on in function file_get_contents
1 called from line 107 of file editconfig_gedcom.php

Warning: file_get_contents(data/wgroleau.ged_conf.php) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/G/T/S/GTSCFL/html/UG/webtrees/editconfig_gedcom.php on line 107

ERROR 2: Cannot modify header information - headers already sent by (output started at /home/content/G/T/S/GTSCFL/html/UG/webtrees/includes/functions/functions.php:394)

Warning: Cannot modify header information - headers already sent by (output started at /home/content/G/T/S/GTSCFL/html/UG/webtrees/includes/functions/functions.php:394) in /home/content/G/T/S/GTSCFL/html/UG/webtrees/editconfig_gedcom.php on line 385

Question information

Language:
English Edit question
Status:
Solved
For:
webtrees Edit question
Assignee:
No assignee Edit question
Solved by:
fisharebest
Solved:
Last query:
Last reply:
Revision history for this message
Wes Groleau (webmaster-unigen) said :
#1

Looked on server. data/wgroleau.ged_conf.php does exist, but it is empty

Tried again, got no error but it is not saving settings.

Revision history for this message
fisharebest (fisharebest) said :
#2

The "edit gedcom config" only updates existing files, it does not generate new ones. Once this file has become corrupted, it will stay corrupted.

These error messages would appear to be symptoms of this missing file, not the cause of it.

However, an earlier bug prevented the _conf.php files from being created, which could explain this problem.

Can you reproduce it with the latest build? If so, can you record the steps taken?

Revision history for this message
Wes Groleau (webmaster-unigen) said :
#3

When I find the time to put in 8234, I will see whether ther's a difference.

Revision history for this message
Wes Groleau (webmaster-unigen) said :
#4

Uploaded 8234.
Tried again to save several changes on first GEDCOM config screen.
No error messages, but when I opened it again, still all the defauls.

Delete the GEDCOM data from the DB and upload it again.
Change the same settings again, save, and re-open.
This time, the new title stayed, but everything else is still default.

Revision history for this message
fisharebest (fisharebest) said :
#5

The title is stored in the DB. The other settings are stored in the _conf.php file.

This suggests a file permissions error writing to this file.

You did not say whether you were trying to re-use and existing _conf.php file, or whether you let webtrees create one in an empty directory.

Revision history for this message
Wes Groleau (webmaster-unigen) said :
#6

OK, permissions. I'll check again.
Webtrees created the file, but then will not write anything into it. Perhaps there has been a umask change that makes files automatically read-only once created? That would be weird, but not beyond the capabilities of my provider. :-)

Are errors like this redirected to a log file?
I think they should be--there was no feedback to the browser.
In fact, that gives me a related idea that I'll write up separately.

Revision history for this message
Wes Groleau (webmaster-unigen) said :
#7

Webtrees created both <gedcom>_*_conf.php files, both with permissions of -rw-r--r--

But the privacy file is all there, and the other is empty. Is it possible a single PHP file failed to upload? I'm not getting any missing file error...

Revision history for this message
fisharebest (fisharebest) said :
#8

Disk full? Quota?

Revision history for this message
Wes Groleau (webmaster-unigen) said :
#9

No, I just used FTP to insert 14 megabytes and then deleted it.
If this is not happening to anyone else, maybe I should delete the entire thing and try putting it in again?

Revision history for this message
Wes Groleau (webmaster-unigen) said :
#10

I just installed the latest snapshot.
Then I deleted my data and ran setup.php, which said
The configuration file has been successfully uploaded to the server.
Checking the access permissions...
The directory data/ has read-write permission. Good.
The directory media/ has read-write permission. Good.
The file data/config.ini.php has read-only permission. Good.

And a start using button which took me to GEDCOM admin.

I uploaded a 29,215-line file, which took about sixty seconds to process.

Then I looked at the data directory:
drwxrwxrwx 2 4741026 523 4096 May 11 18:09 .
drwxr-xr-x 15 4741026 523 12288 May 11 18:00 ..
-rw-r--r-- 1 4741026 523 31 May 9 19:31 .htaccess
-r--r--r-- 1 4741026 523 179 May 9 21:38 config.ini.php
-rw-r--r-- 1 4741026 523 40 May 9 19:31 index.php
-rw-r--r-- 1 4741026 523 0 May 10 20:46 wgroleau.ged_conf.php
-rw-r--r-- 1 4741026 523 10532 May 10 20:43 wgroleau.ged_priv.php

So, deleting and re-uploading a GEDCOM does _not_ delete the old configs. Just in case they are doing something they shouldn't, I again deleted GEDCOM, then those files.

Uploaded same file and now I see
-rw-r--r-- 1 4741026 523 14464 May 11 18:17 wgroleau.ged_conf.php
-rw-r--r-- 1 4741026 523 10532 May 11 18:17 wgroleau.ged_priv.php

Conclusion: Webtrees will not delete a GEDCOM's config files when its data is deleted.
And if it is re-uploaded, it will not replace them.

Should I call this solved, or should it become a bug?

Revision history for this message
Best fisharebest (fisharebest) said :
#11

<<Conclusion: Webtrees will not delete a GEDCOM's config files when its data is deleted.
And if it is re-uploaded, it will not replace them.>>

This is the expected behaviour. IIRC, this was the result of a bug report in PGV. It used to delete them, but was changed to leave them.

In any case, these two files will soon be made redundant - the data in them will be migrated to the wt_gedcom_setting table and a new privacy table.

Revision history for this message
Wes Groleau (webmaster-unigen) said :
#12

Welll, it makes sense that someone might want to delete and reload a GEDCOM and not have to re-do all their settings.
But if the settings aren't there, but the _file_ is, then it's kind of ambiguous. Anyway, no point overanalyzing a retiring item. :-)