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

    Plugin installation failed: package manager exited with code 67

    Scheduled Pinned Locked Moved Solved
    Plugins for DWC and DSF
    3
    11
    354
    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.
    • marvineerundefined
      marvineer
      last edited by

      Hi,

      I am trying to build my own python plugin for DSF. I'm using version 3.5 beta 4 on DuetPi and stumbled across an error message that I can't explain myself.

      When installing the plugin I get the following error message. Note that it does not matter whether I define a particular version (e.g. ==3.4.5.post2 or >=3.4.5.post2) or not.

      error message

      When I open the corresponding script pip3_install.py (located on the SBC: /opt/dsf/bin/) it says the following:

      [...]
      
      Return Codes:
      
      0 - Successfully installed or already installed.  Details are sent to journalctl
      1 = Something nasty happened
      64 - No module was specified.
      65 - Only one module can be specified.
      66 - Unsupported Conditional
      67 - Pip3 could not handle the request
      
      Verson 1.0.1
      Initial Release
      
      [...]
      

      Am I doing something wrong or is this a bug to fix?


      In case it is a mistake by me, here you have my plugin.json and the zip file I used (remove the .txt):

      {
        "id": "TestPlugin",
        "name": "TestPlugin",
        "author": "Marvin M.",
        "version": "0.1",
        "license": "GPL-3.0-or-later",
        "homepage": "https://github.com/marvineer98/",
        "dwcVersion": "3.5.0-beta.4",
        "sbcRequired": true,
        "sbcDsfVersion": "3.5.0-beta.4",
        "sbcExecutable": "my_plugin.py",
        "sbcOutputRedirected": true,
        "sbcPermissions": [
          "commandExecution",
          "codeInterceptionReadWrite",
          "objectModelReadWrite",
          "fileSystemAccess",
          "launchProcesses"
          ],
          "sbcPythonDependencies": ["dsf-python==3.4.5.post2"]
      }
      

      my_plugin.zip.txt

      Thanks!

      chrishammundefined 1 Reply Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators @marvineer
        last edited by

        @marvineer You can track the output of the Python install script via journalctl -u duetpluginservice-root. Running pip3 install dsf-python==3.4.5.post2 completes successfully with exit code 0 on my setup.

        Duet software engineer

        marvineerundefined 1 Reply Last reply Reply Quote 0
        • marvineerundefined
          marvineer @chrishamm
          last edited by marvineer

          @chrishamm thanks for your quick reply.

          I checked the output via journalctl -u duetpluginservice-root:

          Jul 18 10:26:15 MultiPrint DuetPluginService[694]: [info] Plugin MyPlugin: Installing Python package dsf-python>=3.4.5.post2
          Jul 18 10:26:19 MultiPrint DuetPluginService[694]: Module dsf-python>= 3.4.5.post2 could not be installed.
          Jul 18 10:26:19 MultiPrint DuetPluginService[694]: Check the module name and version number(if provided).
          Jul 18 10:26:19 MultiPrint DuetPluginService[694]: [error] DuetPluginService.IPC.Service: Failed to execute InstallPlugin
          Jul 18 10:26:19 MultiPrint DuetPluginService[694]:    System.ArgumentException: Failed to install package dsf-python>=3.4.5.post2, package manager exited with code 67
          Jul 18 10:26:19 MultiPrint DuetPluginService[694]:    at DuetPluginService.Commands.InstallPlugin.InstallPythonPackage(String package) in /home/runner/work/DuetSoftwareFramework/DuetSoftwareFramework/src/DuetPluginService/Commands/InstallPlugin.cs:line 349
          Jul 18 10:26:19 MultiPrint DuetPluginService[694]:    at DuetPluginService.Commands.InstallPlugin.Execute() in /home/runner/work/DuetSoftwareFramework/DuetSoftwareFramework/src/DuetPluginService/Commands/InstallPlugin.cs:line 62
          Jul 18 10:26:19 MultiPrint DuetPluginService[694]:    at DuetAPI.Commands.Command.Invoke() in /home/runner/work/DuetSoftwareFramework/DuetSoftwareFramework/src/DuetAPI/Commands/BaseCommand.cs:line 46
          Jul 18 10:26:19 MultiPrint DuetPluginService[694]:    at DuetPluginService.IPC.Service.Run() in /home/runner/work/DuetSoftwareFramework/DuetSoftwareFramework/src/DuetPluginService/IPC/Service.cs:line 45
          

          Running pip3 install dsf-python==3.4.5.post2 manually runs without an issue:

          Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
          Requirement already satisfied: dsf-python==3.4.5.post2 in /usr/local/lib/python3.7/dist-packages (3.4.5.post2)
          Requirement already satisfied: python-dateutil in /usr/local/lib/python3.7/dist-packages (from dsf-python==3.4.5.post2) (2.8.2)
          Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil->dsf-python==3.4.5.post2) (1.12.0)
          

          @chrishamm Do you have any ideas on how I could proceed?

          chrishammundefined 1 Reply Last reply Reply Quote 0
          • chrishammundefined
            chrishamm administrators @marvineer
            last edited by chrishamm

            @marvineer I'm not sure TBH, that new Python package install script was contributed. You could replace the new install script command in /opt/dsf/conf/config.json (or possibly plugin.json) with pip3 again and check if that works.

            @stuartofmt Any idea?

            PS: That's a DCS log excerpt and nothing from the root DPS service.

            Duet software engineer

            marvineerundefined 1 Reply Last reply Reply Quote 0
            • marvineerundefined
              marvineer @chrishamm
              last edited by

              @chrishamm said in Plugin installation failed: package manager exited with code 67:

              PS: That's a DCS log excerpt and nothing from the root DPS service.

              Sorry, I copied the wrong output ... I have edited my post above

              stuartofmtundefined 2 Replies Last reply Reply Quote 1
              • stuartofmtundefined
                stuartofmt @marvineer
                last edited by

                @marvineer
                Let me take a look at the python dependency install script and see if I can spot anything.

                1 Reply Last reply Reply Quote 1
                • stuartofmtundefined
                  stuartofmt @marvineer
                  last edited by stuartofmt

                  @marvineer
                  I see the problem. It has to do with some inconsistency between the way the runtime recognizes (or not) certain modules.

                  The installer is actually installing OK but then (when it double checks) thinks the module is not there.

                  The workaround for now is to manually install using ‘pip3 install dsf-python==3.4.5.post2‘
                  And remove the dependency from the manifest. This works because the module only needs to be installed once.

                  I’m traveling but should be able to get a fix sorted in the next day or so.

                  marvineerundefined 1 Reply Last reply Reply Quote 1
                  • marvineerundefined
                    marvineer @stuartofmt
                    last edited by

                    @stuartofmt This sounds promising. However, it is not critical for me at all, since the workaround is quite simple (remove from manifest, install manually) - so take your time.

                    Thank you very much for your work!

                    stuartofmtundefined 1 Reply Last reply Reply Quote 0
                    • stuartofmtundefined
                      stuartofmt @marvineer
                      last edited by

                      @marvineer
                      @chrishamm
                      There is a new version (1.0.2) of pip3_install.py
                      located here:
                      https://github.com/stuartofmt/pip3_install/tree/master

                      The installer determines if a module is already available, if it is not: it attempts to install it and then checks to see if the module is now available.

                      What was happening (in this case) was that it could not determine the module was available, successfully installed the module and then failed because it could not verify the installation.

                      I added an additional technique to determine if a module is already installed. Apparently neither alone are bulletproof due to variations in install packages. Using both techniques should be better (especially if pip3 is the installer).

                      marvineerundefined chrishammundefined 2 Replies Last reply Reply Quote 1
                      • marvineerundefined
                        marvineer @stuartofmt
                        last edited by

                        @stuartofmt works for me now, thanks again!

                        1 Reply Last reply Reply Quote 0
                        • marvineerundefined marvineer marked this topic as a question
                        • marvineerundefined marvineer has marked this topic as solved
                        • chrishammundefined
                          chrishamm administrators @stuartofmt
                          last edited by

                          @stuartofmt Thanks, I just updated DSF to your latest install script.

                          Duet software engineer

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