Debugging connection issue with Gramps Web Sync on Mac

[MacOS Sonoma 14.1.1, Gramps 5.1.6, Gramps Web API 1.5.0, Gramps.js 23.12.0]

Hi,

I am running Gramps Web using Docker Compose on a Linux Ubuntu server. Gramps Web appears to work fine.

After downloading and installing the default app package for Gramps on Mac OS and installing the Gramps Web Sync Add-On, I try to connect to the web server using owner credentials but get the error message “Error connecting to server” without further details.

  • The complete URL to base server, username, and password are correct.
  • Using the wrong password yields the same error message.
  • I find no entries in the Mac Console app.

The request does not appear to reach the Gramps Web server as there are

  • No entries in the Apache2 error or access log.
  • No entries in the docker logs (docker-compose logs).

I would be most grateful if anybody has a tip on how to debug the connectivity issue.

Specifically, I wonder how to get more information out from the local Gramps app running on my Mac. Is there a way to debug Add-Ons to see why the connection fails?

I guess one option would be to run Gramps from the command line, but I was hoping to use the default App package…

@emyoulation - thanks for the edit!

When starting the Mac OS Gramps app without command parameters, the documentation states that logs at the WARNING level should be printed.

It would appear that the error reported in the Gramps Web Sync plugin is not logged as a WARNING as no log output appears… :frowning:

Anyone knows the correct LOGGER_NAME to get log output for the Gramps Web Sync add-on when using the the --debug=LOGGER_NAME switch?

1 Like

Here’s the intro to the Gramps logfile article in the wiki:

A fresh Log file is created for each worksession in the application. (This overwrites any previous log since it uses the same name.) A file named Gramps51.log is created in the Gramps User Directory.

(The path differs by OS.) It is a plain text file.

PS: this was this 1st time I’ve found to use Discourse’s linkify terms feature for the logfile

Thanks!

From the Logging system wiki page:

The name of the root logger is an empty string, thus e.g. --debug=“” will enable all debug logs.

Using this switch makes Gramps spew out debug logs as expected, but still no joy for the Gramps Web Sync add-on. In fact, running the add-on produces no log output at all.

To me, this starts to look like a bug and not user error…

Any ideas on how to debug the connectivity issue? Should I log a bug report?

This is a screenshot of the add-on’s screen:

image

As this is a Gramps Web issue and its creator @DavidMStraub is currently the only person experienced enough to do support, let’s wait for him to weigh in. (Reasonably, the holidays might cause a bit of delay.)

It’s hard to say if all the settings are correct; unfortunately the exact error is currently not logged, but you could manually add a log statement where the error is handled in the code (except URLError).

How would a neophyte add a “log statement”?

@Nick-Hall , @prculley , @SNoiraud : This could be a good reference example for how to properly add Debugging gramps51.log functionality to a module that already has GUI error reporting but no actionable tracelog. (“Properly” as in recognizing the --debug command line to output in-depth info only when desired. And when running normally, not impact normal processing load with excessive logging.)

Commenting to follow as I am also experiencing this issue and not sure how to document the exact error. I ran this with the following command:

/Applications/Gramps.app/Contents/MacOS/Gramps --debug=""

And when I went to run web sync, I got the same error described above and I did not see anything in the terminal.

I’m not a developer and may be doing things incorrectly here :innocent:

I have the same problem with Gramps 1.5.6 on MacOS 14.3 Sonoma and Webgramps. With Gramps 1.5.6 on Windows 10 (VM on the very same Mac) the synchronization works flawlessly. So I guess it is a problem with the sync plugin on MacOS.

Neophyte or not, I am actually a developer, just not very experienced in Python and specifically I don’t know Gramps. Tried to get the a developer environment running but in the end it turned out to be too much of hassle… else I would have submitted a patch.

Instead I will just do some very simple dry-coding. :slight_smile:

The error message can be matched to line 429 where the root cause is swallowed and not communicated to the user. This should be fixed by updating the statement to something like:

self.handle_error(_("Error connecting to server: %s") % exc.reason)

In addition, the suggestion by @emyoulation of using this as an example on where to add proper logging, sounds like an excellent idea.

In my opinion, each step of the synchronisation process should be traced at debug level where some key steps are logged at info level. For generic, top level exceptions like the URLError on line 429 you might also consider logging the traceback, as it could shed additional light to what the error actually is, if not evident from the reason property.

My five cents, and as said, would have been happy to submit a patch, if only it had been easier to get a local environment up and running.

2 Likes

Happy to take another swing at this if anyone has a step by step way to do it. I do love Gramps web terminal but I wonder if using the full desktop version would allow me do some things I can’t do in the web app.