Coder Social home page Coder Social logo

Comments (15)

wh1te909 avatar wh1te909 commented on May 28, 2024

is this windows 10 2004? this is a known bug, microsoft changed the the windows update API. I have a fix coming soon.

from tacticalrmm.

wh1te909 avatar wh1te909 commented on May 28, 2024

for the software, from the command line of your server please run sudo salt 'testPC-1' pkg.list_pkgs and post the error here please

from tacticalrmm.

notadevcollins avatar notadevcollins commented on May 28, 2024

The windows 10 build is 2004 so that explains that.

salt returns the correct list of packages in the terminal

The windows pc has salt minion 1.0.3 and tactical rmm agent 0.10.1

from tacticalrmm.

wh1te909 avatar wh1te909 commented on May 28, 2024

ok can you try this

cd /rmm/api/tacticalrmm/
source ../env/bin/activate
python manage.py shell

from agents.models import Agent
agent = Agent.objects.get(salt_id="testPC-1")
agent.salt_api_cmd(timeout=30, func="pkg.list_pkgs")

and see if that also produces some output with a list of software

from tacticalrmm.

notadevcollins avatar notadevcollins commented on May 28, 2024

yes that produces a comma separated list of the installed software,
there is this one item

'Toolkit\x00༈\ue34c崀耀獐\xad\x05': '1.8.2.128\x002\x00φ\ue2b5☀蠀@Pro',

which looks like it could give us trouble, all the other items are standard characters
this software is a seagate toolkit

Im guessing when this data get parsed its getting messed up by that horrible looking line, now I could remove the software and see if that fixes the issue or I could leave it installed to see if you want to try sanitizing,

or that line has nothing to do with the problem...

from tacticalrmm.

wh1te909 avatar wh1te909 commented on May 28, 2024

LOL! that's probably it. ok i'll try to see where it's having trouble parsing it yea leave it for now

from tacticalrmm.

wh1te909 avatar wh1te909 commented on May 28, 2024

ok think i found it can you please try this

cd /rmm/api/tacticalrmm/
source ../env/bin/activate
python manage.py shell

from agents.models import Agent
agent = Agent.objects.get(salt_id="testPC-1")
software = agent.installedsoftware_set.get()

software.software = [{"name": "Microsoft Visual C++ Build Tools", "version": "14.0.25420.1"}, {"name": "Toolkit\x00༈\ue34c崀耀獐\xad\x05", "version": "1.8.2.128\x002\x00φ\ue2b5☀蠀@Pro"}]

software.save()

you should get an error. then try same thing again but just replace it with some regular text and then see if it saves and then reload the software tab on web interface.

from tacticalrmm.

notadevcollins avatar notadevcollins commented on May 28, 2024
(env) rmm@rmm:/rmm/api/tacticalrmm$ source ../env/bin/activate

(env) rmm@rmm:/rmm/api/tacticalrmm$ python manage.py shell

Python 3.8.2 (default, Jul 16 2020, 14:00:26)

[GCC 9.3.0] on linux

Type "help", "copyright", "credits" or "license" for more information.

(InteractiveConsole)

from agents.models import Agent

agent = Agent.objects.get(salt_id="testPC-1")

software = agent.installedsoftware_set.get()

Traceback (most recent call last):

File "", line 1, in

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method

return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/query.py", line 429, in get

raise self.model.DoesNotExist(

software.models.InstalledSoftware.DoesNotExist: InstalledSoftware matching query does not exist.

software.software = [{"name": "Microsoft Visual C++ Build Tools", "version": "14.0.25420.1"}, {"name": "Toolkit\x00༈\ue34c崀
耀獐\xad\x05", "version": "1.8.2.128\x002\x00φ\ue2b5☀蠀@Pro"}]

Traceback (most recent call last):

File "", line 1, in

NameError: name 'software' is not defined

software.save()

Traceback (most recent call last):

File "", line 1, in

NameError: name 'software' is not defined

software.software = [{"name": "Microsoft Visual C++ Build Tools", "version": "14.0.25420.1"}, {"name": "Toolkit", "version": "1.8.2"}]

Traceback (most recent call last):

File "", line 1, in

NameError: name 'software' is not defined

this is what I got, as you would expect I do not have the list of software showing on the panel

from tacticalrmm.

wh1te909 avatar wh1te909 commented on May 28, 2024

Sorry forgot that table in the database didn't exist cuz it was never created due to the error with that weird text. First need to create one so do this first: login to the django admin site then scroll down to Software > Installed softwares add click Add, select your agent and and just paste this into the software field and click add:

[{"name": "Microsoft Visual C++ Build Tools", "version": "14.0.25420.1"}, {"name": "some software", "version": "1.1.1"}]

refresh the software tab in the rmm and you should see the above 2 softwares

then do the steps in my last comment and you should get some sort of json error

from tacticalrmm.

notadevcollins avatar notadevcollins commented on May 28, 2024

how do I get to the django admin page? , i tried /admin and /django-admin and recieve 404 errors, sorry if i'm being a noob

from tacticalrmm.

wh1te909 avatar wh1te909 commented on May 28, 2024

no worries. it was one of the links provided at the end of the install script but if you didn't save it, look at the top of the file /rmm/api/tacticalrmm/tacticalrmm/local_settings.py for ADMIN_URL = "somerandomstring/" and then append that to whatever subdomain you chose for the backend api (not the same one you use to get to the rmm), so like https://api.example.com/somerandomstring/

it's the same credentials you use to login to the rmm

from tacticalrmm.

notadevcollins avatar notadevcollins commented on May 28, 2024

duuuh, I didn't even think to look at the install notes,
added example string via the django admin page, the manually added software now shows up in the rmm panel
following your above example I do receive and error with the bad characters and success removing those characters

software = agent.installedsoftware_set.get()

software.software = [{"name": "Microsoft Visual C++ Build Tools", "version": "14.0.25420.1"}, {"name": "Toolkit\x00༈\ue34c崀
耀獐\xad\x05", "version": "1.8.2.128\x002\x00φ\ue2b5☀蠀@Pro"}]

software.save()

Traceback (most recent call last):

File "/rmm/api/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute

return self.cursor.execute(sql, params)

psycopg2.errors.UntranslatableCharacter: unsupported Unicode escape sequence

LINE 1: ...stalledsoftware" SET "agent_id" = 1, "software" = '[{"name":...
^

DETAIL: \u0000 cannot be converted to text.

CONTEXT: JSON data, line 1: ...uild Tools", "version": "14.0.25420.1"}, {"name":...

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "", line 1, in

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/base.py", line 750, in save

self.save_base(using=using, force_insert=force_insert,

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/base.py", line 787, in save_base

updated = self._save_table(

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/base.py", line 869, in _save_table

updated = self._do_update(base_qs, using, pk_val, values, update_fields,

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/base.py", line 923, in _do_update

return filtered._update(values) > 0

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/query.py", line 803, in _update

return query.get_compiler(self.db).execute_sql(CURSOR)

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1515, in execute_sql

cursor = super().execute_sql(result_type)

File "/rmm/api/env/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1154, in execute_sql

cursor.execute(sql, params)

File "/rmm/api/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute

return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)

File "/rmm/api/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers

return executor(sql, params, many, context)

File "/rmm/api/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute

return self.cursor.execute(sql, params)

File "/rmm/api/env/lib/python3.8/site-packages/django/db/utils.py", line 90, in exit

raise dj_exc_value.with_traceback(traceback) from exc_value

File "/rmm/api/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute

return self.cursor.execute(sql, params)

django.db.utils.DataError: unsupported Unicode escape sequence

LINE 1: ...stalledsoftware" SET "agent_id" = 1, "software" = '[{"name":...
^
DETAIL: \u0000 cannot be converted to text.

software.software = [{"name": "Microsoft Visual C++ Build Tools", "version": "14.0.25420.1"}, {"name": "Toolkit", "version": "1.8.2.128"}]

from tacticalrmm.

wh1te909 avatar wh1te909 commented on May 28, 2024

ok thanks, please extract the python file in this zip and put it in /rmm/api/tacticalrmm/software/management/commands so full path of the file should be /rmm/api/tacticalrmm/software/management/commands/get_software.py

get_software.zip

then

cd /rmm/api/tacticalrmm/
source ../env/bin/activate
python manage.py get_software

and then if it says "Saved successfully!", go to the web and refresh the software tab but don't use the refresh button on the actual software tab, just make sure the agent is selected in the north pane and either just click on the agent again to refresh or use the main refresh button at the top left of the page.

from tacticalrmm.

wh1te909 avatar wh1te909 commented on May 28, 2024

nevermind on the above, just go ahead and update your rmm i've already pushed the changes. Then try refreshing the software from the web using the refresh button on the software tab next to the "Install Software" button.

from tacticalrmm.

notadevcollins avatar notadevcollins commented on May 28, 2024

well done!, looks like you got it, after refreshing the software i get the correct list of installed software

from tacticalrmm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.