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

user information not being retreived from local configuration in Linux #165

Closed
cristobaltapia opened this issue May 30, 2023 · 3 comments
Closed
Assignees
Labels
wontfix This will not be worked on

Comments

@cristobaltapia
Copy link

cristobaltapia commented May 30, 2023

Hi, thanks for this plugin for speckle. I am trying to use this under Linux. I read the instructions posted here but I am getting the following error:

Python: Traceback (most recent call last):
  File "/home/tapiac/.config/blender/3.5/scripts/addons/bpy_speckle/operators/users.py", line 82, in execute
    speckle.active_user = str(active_user_index)
TypeError: bpy_struct: item.attr = val: enum "0" not found in ()

Expected vs. Actual Behavior

The users shuold be shown in the GUI, however, an error is raised.

Reproduction Steps & System Config (win, osx, web, etc.)

  • OS: Linux (Ubuntu 22.04)
  • Blender: 3.5 (snap package)

The plugin is installed under ~/.confg/blender/3.5/scripts/addons/bpy_speckle

I have manually added the configuration file under ~/.local/share/Speckle/Accounts and symlinked Speckle/ to ~/.config/blender/data/Speckle.

❯ ls -lh .config/blender/data 
total 0
lrwxrwxrwx 1 tapiac tapiac 33 Mai 30 11:36 Speckle -> /home/tapiac/.local/share/Speckle

In the folder Accounts I have placed a json file accoriding to the instructions from here.

Running the following commands in the REPL of Blender returns no account:

>>> import bpy_speckle as speckle
>>> speckle.users.get_local_accounts()
[]
@gjedlicska gjedlicska self-assigned this Sep 12, 2023
@gjedlicska
Copy link
Contributor

Hey @cristobaltapia
sorry for being late on this.

Based on your report, you are using blender in a snap package. That is the reason why this is breaking for your. It is also the reason why we do not officially support linux as a target platform for Speckle.
The application sandboxing mechanism for snap packages is set up in a way, that snap based apps have a different way of accessing the hosts file system. This adds extra security, properly sandboxes apps etc. What this boils down to in this case, is that Blender as a snap stores its config files in a different location to what you are using.

I'm not a daily snap user myself, but based on this it should be somewhere in ~/snaps/blender/....

I'm going to close this ticket, since we do not officially support this, but i'd be happy to continue this conversation on our forum https://speckle.community/

@JR-Morgan JR-Morgan added the wontfix This will not be worked on label Sep 12, 2023
@JR-Morgan JR-Morgan closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@cristobaltapia
Copy link
Author

Hi @JR-Morgan, thanks for your reply. I just gave this another try and found the solution. The problem is not with the location of the configuration files for Blender. The snap package is actually using the config folder under ~/.config/blender. So that is good. The problem was the location of the Accounts folder. I thought that it had to be placed under ~/.config/blender/data/Speckle/ but it had to be under ~/.config/Speckle/. Does that make sense? Anyways, it works now, so I thought to post this here for future reference.

@gjedlicska
Copy link
Contributor

Hey @cristobaltapia,

thanks for the test. It does makes sense. Speckle uses a centralized config folder under XDG_CONFIG_HOME which in most cases is ~/.config/Speckle/.

Turns out the blender snap is using classic confinement to allow full access to the host os file system ( if i remember snap terms correctly ). Another variation case in behavior under linux. ( Hence the lack of official support from us for now )
I'm glad it works for you.
Do stop by our forum for a bit of show and tell, we're always curious what ppl are doing with Speckle especially if its pushing the boundaries of our mainstream workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants