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

issue.upload - "Requested resource doesn't exist" #36

Closed
eoghancunneen opened this issue Jul 3, 2014 · 3 comments
Closed

issue.upload - "Requested resource doesn't exist" #36

eoghancunneen opened this issue Jul 3, 2014 · 3 comments
Assignees
Labels

Comments

@eoghancunneen
Copy link

Hi there,
I've encountered an issue when creating a new issue.

    issue = redmine.issue.new()
    issue.project_id = '%s' % project
    issue.subject = subject
    issue.description = description
    issue.save()

Works without any issue.

But, if I also include a file to upload along with the ticket, I receive a "Requested resource does not exist" error.

    issue = redmine.issue.new()
    issue.project_id = '%s' % project
    issue.subject = subject
    issue.description = description
    issue.uploads = [{'path': '/path/to/file.txt'}]
    issue.save()

I have ensured that the file does exist with an os.path.exists() call. Here's some of the stack trace:

 86             raise AuthError()
 87         elif response.status_code == 404:

-> 88 raise ResourceNotFoundError
89 elif response.status_code == 409:
90 raise ConflictError

Would anything immediately seem suspicious? I'm creating a Redmine object with a user's API key, rather than an explicit username/passwd.

Many thanks Max,
Eoghan

@maxtepkeev maxtepkeev self-assigned this Jul 3, 2014
@maxtepkeev
Copy link
Owner

Hi Eoghan!

Can't confirm this error here, everything works for me with your scenario. It seems that http://your-redmine-url/uploads.json returns 404.

Does your user which API key you are using has the rights to attach files to issues ? You can try to use the user which has the admin rights to be sure if this issue is related to user permissions or not.

If that doesn't help please tell me your exact environment (versions of Redmine, Python, Python-Redmine etc.) and I'll try to setup it here and see if I can reproduce this problem.

@eoghancunneen
Copy link
Author

Hi Max,
Sorry - I misread what version of the API was required. I'm running redmine 1.2.x when I need 1.4.x.
Sorry for wasting your time.
Best,
Eoghan

@maxtepkeev
Copy link
Owner

Oh, I see. No problems. By the way if you set the version kwarg when instantiating your Redmine object and set it to your Redmine version then Python-Redmine will tell you when this or that feature won't work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants