unit icon indicating copy to clipboard operation
unit copied to clipboard

"error": "Failed to apply new configuration." - REG

Open harishvgts opened this issue 2 years ago • 2 comments

When I modified the config.json and ran the below curl command I got this issue - "error": "Failed to apply new configuration."

Details: Server: Ubuntu | Django Deployment curl command: sudo curl -X PUT --data-binary @config.json --unix-socket /var/run/control.unit.sock http://localhost/config/ config.json:

{
  "listeners": {
      "*:80": {
          "pass": "routes"
      }
  },

  "routes": [
      {
          "action": {
              "pass": "applications/django"
          }
      }
  ],

  "applications": {
      "django": {
          "type": "python 3.10",
          "path": "//home/ubuntu/vittae/",
          "home": "/home/ubuntu/venv/",
          "module": "unit.wsgi"
      }
  }
}

harishvgts avatar Dec 20 '23 05:12 harishvgts

Language modules typically don't have spaces in them (especially if you're using the official packages).

Try

"type": "python"

lcrilly avatar Dec 20 '23 11:12 lcrilly

Our docs do suggest specifying language versions:

Except for external and wasm, you can detail the runtime version: "type": "python 3", "type": "python 3.4", or even "type": "python 3.4.9rc1". Unit searches its modules and uses the latest matching one, reporting an error if none match.

...so in this case I suspect we're not finding a Python 3.10 and just returning a poor error to the user.

@harishvgts What version of Ubuntu are you using, how did you install Unit, and what are the contents of /usr/lib/unit/modules/?

callahad avatar Jan 05 '24 10:01 callahad