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

bad file descriptor #290

Open
hkyeakley opened this issue Oct 24, 2019 · 1 comment · May be fixed by #387
Open

bad file descriptor #290

hkyeakley opened this issue Oct 24, 2019 · 1 comment · May be fixed by #387

Comments

@hkyeakley
Copy link

Hello,

I have installed go jira in my home directory on one of my admin systems.

The home directory is NFS mounted from an Isilon storage appliance.

If I try to use go jira from my NFS mounted home directory, I get this.

[my_username@linux_box ~]$ jira ls
usage: jira list [<flags>]
alias: jira ls [<flags>]

Prints list of issues for given search criteria

Global flags:
--help Show context-sensitive help (also try --help-long and --help-man).
-v, --verbose ... Increase verbosity for debugging
-e, --endpoint=ENDPOINT Base URI to use for Jira
-k, --insecure Disable TLS certificate verification
-Q, --quiet Suppress output to console
--unixproxy=UNIXPROXY Path for a unix-socket proxy
--socksproxy=SOCKSPROXY Address for a socks proxy
-u, --user=USER user name used within the Jira service
--login=LOGIN login name that corresponds to the user used for authentication

Optional flags:
-t, --template=TEMPLATE Template to use for output
--gjq=GJQ GJSON Query to filter output, see https://goo.gl/iaYwJ5
-a, --assignee=ASSIGNEE User assigned the issue
-c, --component=COMPONENT Component to search for
-i, --issuetype=ISSUETYPE Issue type to search for
-l, --limit=LIMIT Maximum number of results to return in search
-p, --project=PROJECT Project to search for
-n, --named-query=NAMED-QUERY The name of a query in the queries configuration
-q, --query=QUERY Jira Query Language (JQL) expression for the search
-f, --queryfields=QUERYFIELDS Fields that are used in "list" template
-r, --reporter=REPORTER Reporter to search for
-S, --status=STATUS Filter on issue status
-s, --sort=SORT Sort order to return
-w, --watcher=WATCHER Watcher to search for

ERROR Invalid Usage: Failed to save cookie file: bad file descriptor

I have verified that the /home directory is mounted RW and that I have RW to my home directory.

I tried setting my home directory to /var/tmp which is running on LVM via a local disk.

When I run go jira from here, it works fine.

[my_username@linux_box /var/tmp/my_username~]$ jira ls
XYZ-001: Issue #1
XYZ-002: Issue #2
XYZ-003: Issue #3
XYZ-004: Issue #4
XYZ-005: Issue #5
XYZ-006: Issue #6
XYZ-007: Issue #7
XYZ-008: Issue #8
XYZ-009: Issue #9
XYZ-010: Issue #10

But if I go back and try to run go jira from my /home/my_username home directory, I get the error about "ERROR Invalid Usage: Failed to save cookie file: bad file descriptor".

I checked with my SAN admin to see if there is some weird, obscure setting on the SAN that would prevent go jira from writing to a directory that has read/write as far as Linux is concerned.
My SAN guy checked the SAN and things look fine to him.

I'm wondering if this has something to do with sym links.

The /home mount point is actually a sym link to a deep directory structure like /data/dirA/dirB/data/home/my_username.

Can you think of what I could try next to determine why go jira can't write to my home directory?

@hkyeakley
Copy link
Author

It occurred to me to grep for the error message out on the go directory.
The error I'm getting is line 202 of the following file.
go/src/gopkg.in/Netflix-Skunkworks/go-jira.v1/vendor/github.com/coryb/oreo/oreo.go

"return fmt.Sprintf("Failed to save cookie file: %s", e.err)"

Again, if I set my HOME env to /var/tmp/my_username, everything works fine.
But if I leave my home env as /home/my_user, I get this error.

I'm baffled why go jira can interact with /var/tmp but not my home dir.

knedlsepp pushed a commit to knedlsepp/jira that referenced this issue Oct 12, 2020
Before this commit the session cookie and its corresponding lock file
would be placed in the user's home directory. Sadly this breaks all
setups that configure the user's home to live on a NFS mount. File
locking on NFS mounts is something that doesn't work reliably and thus
causes some users to experience issues like this:

    Failed to save cookie file: bad file descriptor

To counteract, this commit instead stores this data in the
$XDG_RUNTIME_DIR which is a directory that is usually located on the
local disk or even located in runtime memory.

This commit will most likely slightly change the behaviour of how
persistent the session data will be stored since often $XDG_RUNTIME_DIR
will be cleared on logout of the user.

Fixes: go-jira#290
knedlsepp pushed a commit to knedlsepp/jira that referenced this issue Oct 12, 2020
Before this commit the session cookie and its corresponding lock file
would be placed in the user's home directory. Sadly this breaks all
setups that configure the user's home to live on a NFS mount. File
locking on NFS mounts is something that doesn't work reliably and thus
causes some users to experience issues like this:

    Failed to save cookie file: bad file descriptor

To counteract, this commit instead stores this data in the
$XDG_RUNTIME_DIR which is a directory that is usually located on the
local disk or even located in runtime memory.

This commit will most likely slightly change the behaviour of how
persistent the session data will be stored since often $XDG_RUNTIME_DIR
will be cleared on logout of the user.

Fixes: go-jira#290
@knedlsepp knedlsepp linked a pull request Oct 12, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant