Error executing scope with long name on PC

Bug #1392529 reported by Riccardo Padovani
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity-scopes-api (Ubuntu)
Won't Fix
Undecided
Unassigned
unity8 (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

I'm developing a scope, but I have this error after the launch, and I'm not able have any response by any query:

com.ubuntu.developer.rpadovani.discerningduck_discerningduck-c
query(): unity::scopes::MiddlewareException: Socket path name too long (max = 107): /tmp/rpadovani/scope-dev-endpoints.USoi22/priv/com.ubuntu.developer.rpadovani.discerningduck_discerningduck-c

The interesting part it's I have two computers, a desktop and a netbook, and I have the error only on the netbook.
Both have same code, both have utopic updated with same apt sources, I have the same username (rpadovani) on both and both are 64bit.

I have no idea on why on one fails and on other doesn't, please let me know if I could provide some logs to debug this.

Alejandro J. Cura suggests this is a bug in the scope registry, because sockets paths do have the limit that the error shows: http://bugs.mysql.com/bug.php?id=42512

Revision history for this message
David Planella (dpm) wrote :

Not a fix, but as a workaround, could you perhaps use a shorter app ID? E.g.

com.rpadovani.discerningduck_discerningduck-c

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity-scopes-api (Ubuntu):
status: New → Confirmed
Revision history for this message
Michi Henning (michihenning) wrote :

Well, the error message pretty much say it all. There is absolutely nothing we can do about the path name limitation, it's baked into the system call interface. (It's a shocking design, but that's just how it is.)

This is what takes the path name over the edge:

rpadovani/scope-dev-endpoints.USoi22

I suspect that this is added by the scope tool. Making this shorter would help to keep things below the limit.

I don't know why you are seeing this on the laptop but not the desktop. Most likely, the generated pathname is shorter for some reason, possible due to the pseudo-random suffix?

Revision history for this message
Michał Sawicz (saviq) wrote :

Indeed, the path comes from registry-tracker.cpp:33

    m_endpoints_dir(QDir::temp().filePath("scope-dev-endpoints.XXXXXX"))

Michi, 107 chars sounds awfully low for a path name, are we sure we won't get into the same problem in real life on production scopes?

Changed in unity8 (Ubuntu):
status: New → Incomplete
no longer affects: qtcreator-plugin-ubuntu (Ubuntu)
Changed in unity8 (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → Medium
Revision history for this message
Michi Henning (michihenning) wrote :

In real l ife, the path is something like /run/user/<uid>/zmq<scope_id> or /run/user/<uid>/zmq/priv/<scope_id>. That leaves around 80 characters for the scope ID.

The 107 character limit is hard-baked into the kernel, so we can't change that. We could do something along the lines of computing an MD4 hash and using that as the name instead, but that would leave the endpoint names incomprehensible, which is not good.

Pragmatically, I think a better solution would be for the scope tool to shorten the prefix it creates.

Revision history for this message
Michi Henning (michihenning) wrote :

Can I close this for unity-scopes-api? Unfortunately, there really isn't anything sensible we can do about this limitation.

Changed in unity-scopes-api (Ubuntu):
status: Confirmed → Won't Fix
Changed in unity8 (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.