• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

can't get plugin to run on 3.5.1

Scheduled Pinned Locked Moved
Plugins for DWC and DSF
1
2
157
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    achrn
    last edited by 26 Apr 2024, 19:14

    I'm trying to get my filament weighing plugin to run on 3.5.1 (and in particular on a new Bookworm DuetPi). It ran on 3.4.2 - as described at https://forum.duet3d.com/topic/25419/another-weighing-filament-holder

    I think I've made the necessary changes in the code, and if I run the script not as a plugin in seems to run fine, but I can't get the plugin to start. When I try and start the plugin in DWC, it just won't - screen flicks, message pops up 'Plugin has been started' but status remains as 'stopped'.

    At the same time syslog gets two lines entry such as

    Apr 26 19:18:40 delta vmunix: [ 7803.069103] audit: type=1400 audit(1714155520.204:29): apparmor="DENIED" operation="exec" class="file" profile="/opt/dsf/plugins/FilamentLoadCell/**" name="/usr/bin/python3.11" pid=6365 comm="weigh_filament_" requested_mask="x" denied_mask="x" fsuid=992 ouid=0
    Apr 26 19:18:40 delta vmunix: [ 7803.069860] audit: type=1400 audit(1714155520.204:30): apparmor="DENIED" operation="exec" class="file" profile="/opt/dsf/plugins/FilamentLoadCell/**" name="/usr/bin/python3.11" pid=6365 comm="weigh_filament_" requested_mask="x" denied_mask="x" fsuid=992 ouid=0

    I don't understand apparmor, but the parts apparmor="DENIED" operation="exec" look like they could be relevant!

    If I remove the apparmor profile entirely (sudo apparmor_parser -R /etc/apparmor.d/dsf.FilamentLoadCell) then I get very slight progress - the status can then go to 'partially started' and the endpoint exists, but the response from the endpoint is empty (zero bytes). I'm not sure what that indicates. The old version used to do that sometimes under 3.4 and stopping and starting it made it work, but that doesn't seem to be the case in 3.5.1.

    Does anyone have any suggestions?

    The custom_http_endpoint.py example doesn't work for me either, though I note it says "Make sure when running this script to have access to the DSF UNIX socket owned by the dsf user." /run/dsf/custom/getIt-GET.sock is srwcr-xr-x so should be OK? It doesn't work even if I run the python script sudo, which I would have thought ought to have access to pretty much anything.

    1 Reply Last reply Reply Quote 0
    • undefined
      achrn
      last edited by 26 Apr 2024, 21:01

      I've tried converting the custom_http_endpoint.py example into a plugin and that goes 'partially started' too.

      I've disabled apparmor in /opt/dsf/conf/plugins.json, just so it can't interfere - my goal would be to put it back on when I've figured out what's going on.

      I've set up a 'test_plugin' that comprises only the custom_http_endpoint.py in folder dsf, and a plugin.json:

      {
      "id": "TestPlugin",
      "name": "Test Plugin",
      "author": "achrn",
      "version": "1.0.1",
      "license": "MIT",
      "dwcVersion": "3",
      "sbcDsfVersion": "3",
      "sbcRequired": true,
      "sbcExecutable": "custom_http_endpoint.py",
      "sbcExecutableArguments": null,
      "sbcOutputRedirected": false,
      "sbcPermissions": ["fileSystemAccess","launchProcesses","registerHttpEndpoints"]
      }

      If I install that plugin it seems to go in OK, in that it appears as an external plugin in the web page, but if I start it, it goes to status 'partially started', and if I then try to access the endpoint (using wget) I get a zero length response. If I try and access the endpoint when the plugin is stopped (ie not even partially started) I get a 500 internal server error.

      /run/dsf/custom/getIt-GET.sock does exist, dsf:dsf and permissions srwxrwxr-x

      So I'm still flummoxed.

      1 Reply Last reply Reply Quote 0
      2 out of 2
      • First post
        2/2
        Last post
      Unless otherwise noted, all forum content is licensed under CC-BY-SA