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

salt jira.create_issue returning text: Field 'priority' cannot be set. It is not on the appropriate screen, or unknown. #51639

Open
ghost opened this issue Feb 14, 2019 · 18 comments
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Milestone

Comments

@ghost
Copy link

ghost commented Feb 14, 2019

saltmaster % sudo salt saltminion1 jira.create_issue NETOPS 'automation test' 'automation test'
saltminion1:
    'jira.create_issue' is not available.

this is on the saltminion in /etc/salt/minion

jira:
  server: https://jira.corp.company.com
  username: salt
  password: pass

Salt Version:
Salt: 2018.3.3

Dependency Versions:
cffi: 1.11.5
cherrypy: Not Installed
dateutil: 2.4.2
docker-py: Not Installed
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.3
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: 2.19
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.12 (default, Dec 4 2017, 14:50:18)
python-gnupg: 0.3.8
PyYAML: 3.13
PyZMQ: 17.1.2
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.2.5

System Versions:
dist: Ubuntu 16.04 xenial
locale: ISO-8859-1
machine: x86_64
release: 4.4.0-124-generic
system: Linux
version: Ubuntu 16.04 xenial

@garethgreenaway
Copy link
Contributor

@juthewiz Thanks for the report. Do you have the jira python library installed on the minion that your attempting to run the jira Salt module?

@garethgreenaway garethgreenaway added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Feb 15, 2019
@garethgreenaway garethgreenaway added this to the Blocked milestone Feb 15, 2019
@ghost
Copy link
Author

ghost commented Feb 15, 2019

@garethgreenaway yes i do, when i when to the minion and ran sudo pip install jira the requirements were already met.

sudo pip instal                                                                                        l jira
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Ple                                                                                        ase upgrade your Python as Python 2.7 won't be maintained after that date. A fut                                                                                        ure version of pip will drop support for Python 2.7.
The directory '/home/julius/.cache/pip/http' or its parent directory is not owne                                                                                        d by the current user and the cache has been disabled. Please check the permissi                                                                                        ons and owner of that directory. If executing pip with sudo, you may want sudo's                                                                                         -H flag.
The directory '/home/julius/.cache/pip' or its parent directory is not owned by                                                                                         the current user and caching wheels has been disabled. check the permissions and                                                                                         owner of that directory. If executing pip with sudo, you may want sudo's -H fla                                                                                        g.
Requirement already satisfied: jira in /usr/local/lib/python2.7/dist-packages (2                                                                                        .0.0)
Requirement already satisfied: pbr>=3.0.0 in /usr/local/lib/python2.7/dist-packa                                                                                        ges (from jira) (5.1.2)
Requirement already satisfied: requests>=2.10.0 in ./.local/lib/python2.7/site-p                                                                                        ackages (from jira) (2.21.0)
Requirement already satisfied: oauthlib[signedtoken]>=1.0.0 in /usr/local/lib/py                                                                                        thon2.7/dist-packages (from jira) (3.0.1)
Requirement already satisfied: defusedxml in /usr/local/lib/python2.7/dist-packa                                                                                        ges (from jira) (0.5.0)
Requirement already satisfied: six>=1.10.0 in ./.local/lib/python2.7/site-packag                                                                                        es (from jira) (1.12.0)
Requirement already satisfied: requests-toolbelt in /usr/local/lib/python2.7/dis                                                                                        t-packages (from jira) (0.9.1)
Requirement already satisfied: requests-oauthlib>=0.6.1 in /usr/local/lib/python                                                                                        2.7/dist-packages (from jira) (1.2.0)
Requirement already satisfied: setuptools>=20.10.1 in ./.local/lib/python2.7/sit                                                                                        e-packages (from jira) (40.6.3)
Requirement already satisfied: certifi>=2017.4.17 in ./.local/lib/python2.7/site                                                                                        -packages (from requests>=2.10.0->jira) (2018.11.29)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./.local/lib/python2.7/s                                                                                        ite-packages (from requests>=2.10.0->jira) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in ./.local/lib/python2.7/site-pac                                                                                        kages (from requests>=2.10.0->jira) (2.8)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in ./.local/lib/python2.7/s                                                                                        ite-packages (from requests>=2.10.0->jira) (1.24.1)
Requirement already satisfied: cryptography; extra == "signedtoken" in ./.local/                                                                                        lib/python2.7/site-packages (from oauthlib[signedtoken]>=1.0.0->jira) (2.5)
Requirement already satisfied: pyjwt>=1.0.0; extra == "signedtoken" in /usr/loca                                                                                        l/lib/python2.7/dist-packages (from oauthlib[signedtoken]>=1.0.0->jira) (1.7.1)
Requirement already satisfied: enum34; python_version < "3" in ./.local/lib/pyth                                                                                        on2.7/site-packages (from cryptography; extra == "signedtoken"->oauthlib[signedt                                                                                        oken]>=1.0.0->jira) (1.1.6)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in ./.local/lib/python2.7/site                                                                                        -packages (from cryptography; extra == "signedtoken"->oauthlib[signedtoken]>=1.0                                                                                        .0->jira) (1.11.5)
Requirement already satisfied: asn1crypto>=0.21.0 in ./.local/lib/python2.7/site                                                                                        -packages (from cryptography; extra == "signedtoken"->oauthlib[signedtoken]>=1.0                                                                                        .0->jira) (0.24.0)
Requirement already satisfied: ipaddress; python_version < "3" in ./.local/lib/p                                                                                        ython2.7/site-packages (from cryptography; extra == "signedtoken"->oauthlib[sign                                                                                        edtoken]>=1.0.0->jira) (1.0.22)
Requirement already satisfied: pycparser in ./.local/lib/python2.7/site-packages                                                                                         (from cffi!=1.11.3,>=1.8->cryptography; extra == "signedtoken"->oauthlib[signed                                                                                        token]>=1.0.0->jira) (2.19)

@max-arnold
Copy link
Contributor

JIRA module was added in the Fluorine branch and is not available in 2018.3.3

@garethgreenaway
Copy link
Contributor

@max-arnold Thanks. @juthewiz Can you confirm that you haven't downloaded the Jira module from the 2019.2 release and are attempting to use it with the 2018.3 release? This will likely work, but as @max-arnold pointed out, that module is only available in the 2019.2 release.

@ghost
Copy link
Author

ghost commented Feb 16, 2019

@max-arnold @garethgreenaway i havent downloaded that modile for that release. how do i install the 2019 version of salt? below is how i initially installed it (master) also i am getting i have the latest version see output

Reading package lists... Done
Building dependency tree
Reading state information... Done
salt-master is already the newest version (2018.3.3+ds-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh -M
@ghost
Copy link
Author

ghost commented Feb 17, 2019

@max-arnold @garethgreenaway i am now getting an error related to the smtp hostname and SSL. But the error is saying it doesnt match either of two options...and the first option it should match as its jira.corp.(company name).com and it should match the first option '.(company name).com'

SSLError: hostname 'jira.corp.company.com' doesn't match either of '*.company.com', 'company.com'


    The minion function caused an exception: Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1660, in _thread_return
        return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
      File "/usr/lib/python2.7/dist-packages/salt/executors/direct_call.py", line 12, in execute
        return func(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/salt/modules/jira_mod.py", line 161, in create_issue
        password=password)
      File "/usr/lib/python2.7/dist-packages/salt/modules/jira_mod.py", line 76, in _get_jira
        logging=True)  # We want logging
      File "/usr/local/lib/python2.7/dist-packages/jira/client.py", line 472, in __init__
        si = self.server_info()
      File "/usr/local/lib/python2.7/dist-packages/jira/client.py", line 2133, in server_info
        j = self._get_json('serverInfo')
      File "/usr/local/lib/python2.7/dist-packages/jira/client.py", line 2549, in _get_json
        r = self._session.get(url, params=params)
      File "/usr/local/lib/python2.7/dist-packages/jira/resilientsession.py", line 151, in get
        return self.__verb('GET', url, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/jira/resilientsession.py", line 146, in __verb
        raise exception
    SSLError: hostname 'jira.corp.company.com' doesn't match either of '*.comapny.com', 'company.com'

@garethgreenaway
Copy link
Contributor

That appears to be an error outside of Salt, it appears you're trying to access a site using SSL at the address jira.corp.company.com but it is setup to use a wild card SSL certificate for *. company.com not *.corp.company.com.

@ghost
Copy link
Author

ghost commented Feb 17, 2019

@garethgreenaway thank you i will look into this internally with my team

@ghost
Copy link
Author

ghost commented Feb 17, 2019

@garethgreenaway @max-arnold quick question does the jira server config go into the minion file under /etc/salt/ or does it get its own conf file similar to smtp in /etc/salt/minion.d/

@garethgreenaway
Copy link
Contributor

It can go in /etc/salt/minion or a separate file in /etc/salt/minion.d

@ghost ghost closed this as completed Feb 18, 2019
@ghost ghost reopened this Feb 19, 2019
@ghost
Copy link
Author

ghost commented Feb 19, 2019

i corrected the SSLerror and i am now seeing a JIRAerror @garethgreenaway @max-arnold


JIRAError: JiraError HTTP 405 url: https://jira.corp.company.com/rest/api/2/issue

        response headers = {'X-AUSERNAME': 'svc-bjar', 'X-AREQUESTID': '899x26950744x1', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-ASESSIONID': 'zrfmvj', 'Server': 'nginx/1.4.6 (Ubuntu)', 'Connection': 'keep-alive', 'Allow': 'POST,OPTIONS', 'Date': 'Tue, 19 Feb 2019 22:59:35 GMT', 'Content-Type': 'text/html;charset=UTF-8', 'X-ASEN': 'SEN-L13008264'}
        response text =
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 410, in salt_call
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cli/call.py", line 57, in run
    caller.run()
  File "/usr/lib/python2.7/dist-packages/salt/cli/caller.py", line 138, in run
    ret = self.call()
  File "/usr/lib/python2.7/dist-packages/salt/cli/caller.py", line 237, in call
    ret['return'] = self.minion.executors[fname](self.opts, data, func, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/executors/direct_call.py", line 12, in execute
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/modules/jira_mod.py", line 179, in create_issue
    issue = jira_.create_issue(data)
  File "/usr/local/lib/python2.7/dist-packages/jira/client.py", line 1107, in create_issue
    r = self._session.post(url, data=json.dumps(data))
  File "/usr/local/lib/python2.7/dist-packages/jira/resilientsession.py", line 154, in post
    return self.__verb('POST', url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/jira/resilientsession.py", line 147, in __verb
    raise_on_error(response, verb=verb, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/jira/resilientsession.py", line 57, in raise_on_error
    r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 405 url: https://jira.corp.company.com/rest/api/2/issue

        response headers = {'X-AUSERNAME': 'svc-bjar', 'X-AREQUESTID': '899x26950744x1', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-ASESSIONID': 'zrfmvj', 'Server': 'nginx/1.4.6 (Ubuntu)', 'Connection': 'keep-alive', 'Allow': 'POST,OPTIONS', 'Date': 'Tue, 19 Feb 2019 22:59:35 GMT', 'Content-Type': 'text/html;charset=UTF-8', 'X-ASEN': 'SEN-L13008264'}
@ghost
Copy link
Author

ghost commented Feb 20, 2019

@garethgreenaway the above is due to missing the S in http:// for the jira server. then i added a / to the end of the URL and now i am getting

JIRAError: JiraError HTTP 400 url: https://jira.corp.company.com/rest/api/2/issue
        text: Field 'priority' cannot be set. It is not on the appropriate screen, or unknown.

        response headers = {'X-AUSERNAME': 'salt', 'X-AREQUESTID': '394x27174912x1', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-ASESSIONID': 'vn3yhd', 'Server': 'nginx/1.4.6 (Ubuntu)', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Wed, 20 Feb 2019 14:34:55 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'X-ASEN': 'SEN-L13008264'}
        response text = {"errorMessages":[],"errors":{"priority":"Field 'priority' cannot be set. It is not on the appropriate screen, or unknown."}}

@garethgreenaway
Copy link
Contributor

@juthewiz What was the Salt command you used? The priority is a valid argument that the create_issue function should accept, but that looks like it might be an error being sent back from Jira.

@garethgreenaway
Copy link
Contributor

garethgreenaway commented Feb 20, 2019

@juthewiz This looks like it might be the solution, the comment where the original poster indicates a solution mentions user rights.
https://community.atlassian.com/t5/Answers-Developer-Questions/Field-Priority-cannot-be-set-It-is-not-on-the-appropriate-screen/qaq-p/561133

@ghost
Copy link
Author

ghost commented Feb 21, 2019

@garethgreenaway looking into this now thanks

@ghost
Copy link
Author

ghost commented Feb 22, 2019

@garethgreenaway going to raise my permission to admin from dev. and will see if that helps. i will check back in tomorrow :)

@ghost
Copy link
Author

ghost commented Feb 22, 2019

@garethgreenaway after i made the user an admin for the jira project i still received the same error about the priority field . jira modules do work though as jira.add_comment returned true and the comment was added to the specified jira

JIRAError: JiraError HTTP 400 url: https://jira.corp.company.com/rest/api/2/issue
        text: Field 'priority' cannot be set. It is not on the appropriate screen, or unknown.

        response headers = {'X-AUSERNAME': 'skynet', 'X-AREQUESTID': '855x27883309x2', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-ASESSIONID': '16qhobk', 'Server': 'nginx/1.4.6 (Ubuntu)', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Fri, 22 Feb 2019 22:15:53 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'X-ASEN': 'SEN-L13160839'}
        response text = {"errorMessages":[],"errors":{"priority":"Field 'priority' cannot be set. It is not on the appropriate screen, or unknown."}}

@ghost ghost changed the title salt jira.create_issue returning 'jira.create_issue' is not available. Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
2 participants