Neriderc / GVExport

Repository for GVExport module for Webtrees
GNU General Public License v2.0
15 stars 6 forks source link

Error running GVExport in browser mode: Error: syntax error in line 1 #501

Open elysch opened 3 weeks ago

elysch commented 3 weeks ago

Hello.

Recently, when I try to get a GVExport report, I'm getting the following error "Error running GVExport in browser mode: Error: syntax error in line 1"

Screenshot_20240822-124214-976

I've noticed that if I set 3 ancestors levels and 3 descendents levels it works, but I would like to have more descendants levels than that.

Not even to download a pure Dot file.

I think it is related to the amount of information to graph. Right?

I'm using webtrees 2.1.20 and this appears in the module's list in the control pannel:

This is the "GVExport" module Custom module 2.1.21 https://github.com/Neriderc/GVExport

I have graphviz versión 2.40.1-45 installed in a Linux server

Any pointers on getting additional information to help find the problem is welcome.

Where is stored the temporary dot file or how to get the generated dot file to test the server's graphviz tool?

Ely

Neriderc commented 3 weeks ago

Sorry to hear you're having trouble!

I think it is related to the amount of information to graph. Right?

Typically it's not a problem, I can generate a 2000 individual diagram without issue. Normally it's something in the details of a specific individual, and when you expand the diagram they get included and it breaks.

Where the DOT file is stored will depend on your setup, it requests the temp directory details for the OS (if you're running in docker, it will be inside the container). Here's the snippet where it's requested: $temp_dir = (new File())->sys_get_temp_dir_my() . "/" . md5(Auth::id());

On linux it's likely to be a directory like /tmp/0266e33d3f546cb5436a10798e657d97 (but a different selection of random characters), and it makes a file called gvexport.dot.

Alternatively, the full DOT file should be included in the output. It goes a bit funny with the error but you should be able to right click on the diagram area below the error message where the DOT contents are, and choose to "Inspect" the element. Then you can find the element in the HTML and copy the contents. Let me know if you need more specific instructions.

One other thing to try is turning off images. I have seen this when there are errors in image files. If disabling photos in the settings resolves it, that will help narrow down the issue.

Let me know how you get on!

elysch commented 2 weeks ago

Hello. Thank you for your prompt response.

I found the generated export.dot file. I noticed the actual dot was inside and extracted it. Executed dot -Tpdf /tmp/gvexport.dot-ERROR.dot -o /tmp/outfile-ERROR.pdf It couldn't find any image, but generated a correct pdf file.

Then, since I couldn't find an option to turn off images, I just renamed the data/images directory in order to prevent it from finding them, but I just received the same error when I clicked the Update button on the web page.

Any ideas on how to find the corrupted/not compatible image?

By the way, the view debug information button doesn't work, at least in my Android device using Chrome. I found that information inside de gvexport.dot :)

Thanks again.

Neriderc commented 2 weeks ago

Any ideas on how to find the corrupted/not compatible image?

First thing to check is in GVExport, turn off photos and make sure it's working again. You do this in Appearance -> Tile Design -> Photos (you'll need to open the advanced settings toggle for the Appearance section if not already enabled). This will ensure that it's an issue with the photos that is causing the error.

If this works, I would enable it again (so you are back to having it broken), then use a process of elimination. You know which level it breaks on, so you should know which generation you're looking at. Sounds like you were having trouble with descendants, so I would start with a root person where it's broken, then select one of their children and check if it's broken. Then check the next child, and the next. In theory, only one child will still show the error (if you only have one problem image), then you can move on to using each grandchild as the root person.

If the image is a problem, it will be a problem regardless of how many people in the diagram, so by testing different branches of the tree at a time you should be able to narrow down the problem image (though do keep in mind there may be multiple).

If you identify the problem image, I've found that opening it in some image editing software then saving it again should help. Image editing software generally handles errors in images a lot more gracefully, so I haven't had any issues opening the images in image editing software even if they do have errors.

By the way, the view debug information button doesn't work, at least in my Android device using Chrome. I found that information inside de gvexport.dot :)

Yes, I don't think mobile browsers generally support this, you'd need a desktop browser, but good to see you found a way to get it.

elysch commented 2 weeks ago

Thank you for your help.

I discovered it fails also disabling the photos. It happens when I add the "Anyone" relationship checkbox. Haven't been able to pinpoint the "branch" of my genealogy tree where is the problem.

I'll keep trying.

Ely

P.S. the View Debug button does nothing, also using latest Chrome in windows 11. Just to inform.

Neriderc commented 2 weeks ago

I discovered it fails also disabling the photos.

It's probably not an image problem then! I'd probably look at special characters, or anything odd in people's names (e.g. \ / ? etc).

It happens when I add the "Anyone" relationship checkbox.

This checkbox can create a significantly larger family tree, depending on what information you have on non-relatives. But it should help narrow down which individual may be the problem.

There are many options in the "Tile contents" area of the "Appearance" settings. You could try disabling them one by one to try to narrow it down. Change the name abbreviation to "None" to not show names, remove date and place of birth/death. If you remove all information on the tiles then then you get shapes only, and it would be interesting to know if that resolves the issue. If so, it probably confirms an issue with some specific information displayed.

Please do let me know when you work it out. It's nice to pinpoint these issues and see if it can be resolved through a change in GVExport.

P.S. the View Debug button does nothing, also using latest Chrome in windows 11. Just to inform.

Thanks! The code seems to have been removed, I had to go back two years to find it! So it must have been broken for a while. Looks like it relied on the old help functionality, and it broke when we moved to the new help panel. Should be fixed now. The debug log might help you work out where it's going wrong.

If you want to update, you can install from the main branch code. Let me know if you need more help with this but the short instructions are to go to the main page of this repository, check the dropdown under the GVExport header to make sure it says "main", then click the green Code button then choose to "Download ZIP". Install as normal, making sure the folder doesn't have any dots in it as webtrees ignores extensions with a dot in the folder name.

elysch commented 2 weeks ago

Thanks! The code seems to have been removed, I had to go back two years to find it! So it must have been broken for a while. Looks like it relied on the old help functionality, and it broke when we moved to the new help panel. Should be fixed now. The debug log might help you work out where it's going wrong.

Wow, hahaha. Thank you.

About my problem... I disabled all data. It now shows only colored boxes when it works.

Can't find a way to search for non related people. I'll keep trying and let you know.

Thanks

elysch commented 2 weeks ago

Ok.

Thanks to the debug button (well it was easier), I took all the names when it worked and when it didn't (only changing from 3 generations of descendents to 4 generations of descendents)

That gave me 184 individuals to check.

Going one by one (and searching inside the graph in order to skip some entries and checking if the tree had more occurrences of the same name) got into a person, without the "Anyone" checkbox where failed. Then tried ancestors and descendents until I got into an individual who is child of a family without parents, he has two siblings.

I tested all three siblings and all fail when I enable 1 generation of ancestors, and it works ok if I disable the ancestors checkbox.(With descendents unchecked)

I've Just added a nameless parent in that family and now the whole graph works just fine.

If you want me to try any fix you make, just tell me.

One new question. I have about a hundred more people than the ones included in the graph. I think they are simply non related people at all and that's why they don't appear. Right?

Is there a way to show them all, even if they appear in the side?

Thanks in advance

Neriderc commented 2 weeks ago

Thanks for the update!

Then tried ancestors and descendents until I got into an individual who is child of a family without parents, he has two siblings.

I tested all three siblings and all fail when I enable 1 generation of ancestors, and it works ok if I disable the ancestors checkbox.(With descendents unchecked)

I wasn't able to reproduce this. Do you have more info on this? Perhaps an example GEDCOM snippet for the family (you can change the names or black them out, it's the structure I'm interested in)?

I had a test individual, added a parent and a sibling, then deleted the parent in order to get a family with no parents. This seems to display fine for me: image

The GEDCOM for the family looks like this: image

It would be good to understand more about the structure to try to reproduce the error.

One new question. I have about a hundred more people than the ones included in the graph. I think they are simply non related people at all and that's why they don't appear. Right?

The way this works is that it starts from one individual, and follows links to other individuals. If for example you have "partners" disabled, it will ignore partner links and only follow the relative links. If you have "anyone" selected, then every link to another person is followed.

It stops when it hits the number of generations. If a link to an individual wasn't reached by that generation then they won't be included. So if you set the number of generations of descendants/ancestors to high numbers (say, 100), then everyone who is linked to the starting individual should be included.

If the individuals are not linked at all, then you can add them as an additional starting person and they should be shown in the same diagram as a separate group of people (though we don't have much control over exactly where they are displayed, so sometimes they may still be scattered through the other group even though they aren't actually linked).

elysch commented 2 weeks ago

Strange thing you couldn't reproduce the error.

A family just like the one you showed gives me the error...

To test this, here are the steps I took to reproduce de error:

1) Go to control panel and add an unrelated male person and save "going to the new individual". Just assigned a name "John /Doe/", Given name: John, Surname Doe. 2) Add a father and just "save" (not going to the new individual). Just assigned Name /Doe/, Surname Doe 3) Add Sibling and just assigned Name Michael /Doe/, Given name Michael, Surname Doe. (Just Save) 4) Opened the new family 5) Right Clicked on the father and opened it in a new tab twice 6) In one of the new tabs I tested the GVExport Graph. Everything works 7) In the other new tab clicked on the tree lines menu and selected delete person (something like that) and accepted all messages 8) Went back to the original tab and clicked on one of the childs 9) Tried the GVExport Graph and received the error:

Error running GVExport in browser mode:
Error: syntax error in line 1
DOT contents
digraph WT_Graph {
ranksep="0.15 equally"
nodesep="0.15"
dpi="72"
mclimit="1"
rankdir="LR"
pagedir="LT"
bgcolor="#eeeeee"
edge [ style=solid, arrowhead=normal, arrowtail=none];
node [ shape=plaintext font_size="10" fontname="Arial"];
F_X593_X593_ [ label=<<TABLE COLOR="#606060" BORDER="0" CELLBORDER="1" CELLPADDING="2" CELLSPACING="0"><TR><TD COLOR="#606060"  BORDER="1" CELLPADDING="0" PORT="X593"><TABLE BORDER="0" CELLBORDER="0" CELLPADDING="2" CELLSPACING="0" BGCOLOR="#fefefe" TARGET="_blank" HREF="https://genealogy.mitalteli.com/webtrees/index.php?route=%2Fwebtrees%2Ftree%2Ffamilia%2Findividual%2FX593%2FJohn-Doe"><TR><TD COLSPAN="6" CELLPADDING="2" BGCOLOR="#add8e6" PORT="nam" WIDTH="30" HEIGHT="30"></TD></TR></TABLE></TD></TR></TABLE>> tooltip=" "];
X595 [ label=<<TABLE COLOR="#606060" BORDER="0" CELLBORDER="1" CELLPADDING="2" CELLSPACING="0"><TR></TR>
</TABLE>> tooltip=" "];
F_X596_X596_ [ label=<<TABLE COLOR="#606060" BORDER="0" CELLBORDER="1" CELLPADDING="2" CELLSPACING="0"><TR><TD COLOR="#606060"  BORDER="1" CELLPADDING="0" PORT="X596"><TABLE BORDER="0" CELLBORDER="0" CELLPADDING="2" CELLSPACING="0" BGCOLOR="#fefefe" TARGET="_blank" HREF="https://genealogy.mitalteli.com/webtrees/index.php?route=%2Fwebtrees%2Ftree%2Ffamilia%2Findividual%2FX596%2FMichael-Doe"><TR><TD COLSPAN="6" CELLPADDING="2" BGCOLOR="#add8e6" PORT="nam" WIDTH="30" HEIGHT="30"></TD></TR></TABLE></TD></TR></TABLE>> tooltip=" "];
X595 -> F_X593_X593_:X593 [color="#555555", arrowsize=0.3] 
X595 -> F_X596_X596_:X596 [color="#555555", arrowsize=0.3] 
}

Not only that. I removed the "1 HUSB @X585@" gedcom entry in the original family that gave problems, and they came back. Added it again and the problems went away.

Hope this helps.

P.S. About the people who doesn't appear in the Graph. The problem is find their names in order to add them to the graph. :(

Neriderc commented 2 weeks ago

Thanks for the steps, I still couldn't reproduce it which I thought was odd, but I worked out it causes the error in Combined mode. I was using Separated.

In Separated mode, people are separate from the family record. If the parents don't exist it doesn't matter, because the children hang off the family record. But in combined mode, it tries to draw one combined record for the parents and family record. With a family with no parents, it breaks!

It's easy enough to make it not break. However, the real question is what it should look like. With no parents and no information about the marriage, it's a bit weird looking: image

Perhaps it's ok to look like this? After all, there's nothing to show. Or maybe you (or someone else reading) might have an idea for how it should show?

elysch commented 2 weeks ago

I should have attached an image of it working. I'm glad you found a way to reproduce it.

About the layout I think maybe it would look ok if you could leave the box empty, make it a little bigger and use dotted lines for it.

Neriderc commented 1 week ago

Thanks for the suggestion! I haven't been able to find a way to get Graphviz to draw a dotted line in a way that works with the existing table structure of the node. I think just making the box a bit bigger will probably look ok.

Unfortunately, getting it set up in the default look is easy, but there's a bit of work to get it to react to all the settings in the same way that the other boxes react. I'm going to work on what's the best way to do this, and so long as I'm successful I'll aim to target the next release (which now has a pretty big list).

Currently someone else is working on a feature, and any changes here will be touching some pretty critical parts of the module, so I'm going to wait until they are done before working on this further in order to avoid conflicting changes. Hopefully you've got a setup that works, and you can look forward to a proper fix in the next release (whenever that comes).

In the meantime, I'll mark this as a bug, as I think we can confidently say that it is a bug.