Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 202834

Summary: Submit fails silently
Product: z_Archived Reporter: David Green <greensopinion>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: robert.elves, steffen.pingel
Version: unspecified   
Target Milestone: 2.1   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 186379    
Bug Blocks:    
Attachments:
Description Flags
mylyn/context/zip
none
the results of a post followed by a get, this time with the issue id specified in the get
none
My repository settings
none
a screenshot of the browser-based request headers
none
mylyn/context/zip none

Description David Green CLA 2007-09-10 15:30:23 EDT
Using the issue editor in eclipse to edit an issue, then pressing save appears to save normally (there is no indication of any error).  
However, when the repository is checked for the changes via the JIRA web application interface, the changes are not in fact saved.  
The same problem appears when saving a context to a JIRA issue: eclipse doesn't indicate any error, however the context does
not appear as an attachment to the JIRA when checking the web interface.
Comment 1 Eugene Kuleshov CLA 2007-09-10 16:31:31 EDT
You are describing two unrelated issues. 

For the first one, as far as I know you do need to submit your issue explicitly using submit button in the task editor. So, it is working as expected. Rob, can you please confirm that.

However all attachment support (including attaching task context) don't work in offline mode and you should get a error or warning when trying to submit. Also see bug 149210 and bug 152271
Comment 2 David Green CLA 2007-09-10 17:34:22 EDT
I've tried pressing the "submit" button with the same result.
Comment 3 David Green CLA 2007-09-10 17:36:13 EDT
Perhaps I should be more clear:

- there appears to be no way to "save" changes to a JIRA issue, either by using 'Ctrl+S', or by pressing the 'Submit' button in the editor itself.
- the editor does not make any indication of a problem saving via either method
- the editor refreshes and all changes are lost
Comment 4 Eugene Kuleshov CLA 2007-09-10 17:54:03 EDT
Can you please be more specific what kind of changes you are doing? I can see that newly added comment is saved ok and I can see outgoing change in the task list, which stays there after I synchronize that task (F5).
Comment 5 David Green CLA 2007-09-10 18:35:41 EDT
Scenario 1: I type in the "new comment" area of a JIRA, then press the submit button.
Scenario 2: I right click on the task in the Task List view, and select "Context->Attach"
Comment 6 Eugene Kuleshov CLA 2007-09-10 19:15:50 EDT
Ok. Let's take one thing at a time. Please answer the following questions:

- do you have any errors in the Eclipse logs or in Error Log view?
- what is the version of your JIRA server and version of Mylyn JIRA connector
- does validate settings button in JIRA repo properties works?
- can you get query results back from the server?

You may also want to check the following FAQ page about JIRA connector http://wiki.eclipse.org/Mylyn_FAQ#JIRA_Connector
Comment 7 David Green CLA 2007-09-11 12:26:22 EDT
(In reply to comment #6)

My answers below:

> Ok. Let's take one thing at a time. Please answer the following questions:
> 
> - do you have any errors in the Eclipse logs or in Error Log view?

No errors at all.

> - what is the version of your JIRA server and version of Mylyn JIRA connector

JIRA server: Enterprise Edition, Version: 3.7.2-#186
Mylyn JIRA connector: 2.0.0.v20070627

> - does validate settings button in JIRA repo properties works?

Yes, confirmation message appears.

> - can you get query results back from the server?

Yes, read-only access seems to work really well.

> 
> You may also want to check the following FAQ page about JIRA connector
> http://wiki.eclipse.org/Mylyn_FAQ#JIRA_Connector
> 

Comment 8 Eugene Kuleshov CLA 2007-09-11 13:04:57 EDT
Thanks David. It seems like you are using quite old JIRA connector and we already have number of fixes, including better error handling. Can you please update and try most recent dev build or 2.1m1 from the update site listed at http://www.eclipse.org/mylyn/downloads/builds.php
Comment 9 David Green CLA 2007-09-11 17:39:45 EDT
Looks like the latest dev build and sources from HEAD have the same problem.
Comment 10 Eugene Kuleshov CLA 2007-09-11 18:19:14 EDT
Also, you could try to enable debug tracing as described at http://wiki.eclipse.org/Mylyn_FAQ#Reporting_issues bit it probably won't help, since you are not seeing any errors in the logs (which is really weird). 

Other then that, since you already have source code, you can try to step trough in the debugger. Put a breakpoint at sourceJiraTaskDataHandler.postTaskData(..) and see if you can capture server response for your submissions.
Comment 11 Eugene Kuleshov CLA 2007-09-11 18:19:18 EDT
Created attachment 78114 [details]
mylyn/context/zip
Comment 12 David Green CLA 2007-09-11 19:10:35 EDT
Looks like the POST at JiraWebIssueService line 188 returns HTTP 302.  This appears to be the only HTTP error message for which an error is not logged:

					if (result != HttpStatus.SC_MOVED_TEMPORARILY) {
						handleErrorMessage(post, result);
					}

Obviously on 302 the data is not saved, so I don't know why the "if" statement is there.

Comment 13 Eugene Kuleshov CLA 2007-09-11 19:53:47 EDT
302 response is a normal JIRA behavior, it is simply redirecting to the page that shows task info. Can you try to follow that redirect and capture html for the page  you are being redirected to?
Comment 14 Mik Kersten CLA 2007-09-11 20:46:20 EDT
David: could you please also summarize all of your proxy/network settings, and whether they're global (set via Preferences) or repository specific?
Comment 15 David Green CLA 2007-09-12 00:15:39 EDT
of course :) these things are not always as simple as they seem (302 was not intuitive to me initially, but it makes sense now - redirect after post)

My network settings are straightforward.  No proxies or special settings, just a simple network connection.

I'll attempt to reproduce tomorrow and output the response to the console.
Comment 16 David Green CLA 2007-09-13 13:13:51 EDT
This is the results of the post.  I'm going to try again, setting followRedirects to true on the post to see what the resulting page shows.

Post result: 302
	Date: Thu, 13 Sep 2007 17:07:54 GMT
	Server: Apache/2.0.59 (FreeBSD) mod_ssl/2.0.59 OpenSSL/0.9.7e-p1 mod_jk/1.2.21
	Location: https://portal.makesolutions.ca/jira/secure/EditIssue.jspa
	Content-Length: 379
	Connection: close
	Content-Type: text/html; charset=iso-8859-1
response body: 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://portal.makesolutions.ca/jira/secure/EditIssue.jspa">here</a>.</p>
<hr>
<address>Apache/2.0.59 (FreeBSD) mod_ssl/2.0.59 OpenSSL/0.9.7e-p1 mod_jk/1.2.21 Server at portal.makesolutions.ca Port 80</address>
</body></html>
Comment 17 Steffen Pingel CLA 2007-09-13 13:18:29 EDT
In your repository settings did you use http://... or https:// for the repository url?
Comment 18 David Green CLA 2007-09-13 13:25:51 EDT
So I tried again, and here's what I got:

************************************************************
POST '/jira/secure/EditIssue.jspa' result: 302
	Request Headers:
		Content-Type: application/x-www-form-urlencoded; charset=utf-8
		User-Agent: Eclipse Mylyn (HttpClient/3.0.1)
		Host: portal.makesolutions.ca
		Cookie: $Version=0; JSESSIONID=********************************; $Path=/jira
		Content-Length: 8337
	Response Headers:
		Date: Thu, 13 Sep 2007 17:23:31 GMT
		Server: Apache/2.0.59 (FreeBSD) mod_ssl/2.0.59 OpenSSL/0.9.7e-p1 mod_jk/1.2.21
		Location: https://portal.makesolutions.ca/jira/secure/EditIssue.jspa
		Content-Length: 379
		Connection: close
		Content-Type: text/html; charset=iso-8859-1
response body: 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://portal.makesolutions.ca/jira/secure/EditIssue.jspa">here</a>.</p>
<hr>
<address>Apache/2.0.59 (FreeBSD) mod_ssl/2.0.59 OpenSSL/0.9.7e-p1 mod_jk/1.2.21 Server at portal.makesolutions.ca Port 80</address>
</body></html>



************************************************************
GET '/jira/secure/EditIssue.jspa' result: 500
	Request Headers:
		User-Agent: Eclipse Mylyn (HttpClient/3.0.1)
		Host: portal.makesolutions.ca
		Cookie: $Version=0; JSESSIONID=********************************; $Path=/jira
	Response Headers:
		Date: Thu, 13 Sep 2007 17:23:33 GMT
		Server: Apache/2.0.59 (FreeBSD) mod_ssl/2.0.59 OpenSSL/0.9.7e-p1 mod_jk/1.2.21
		Content-Length: 5126
		Connection: close
		Content-Type: text/html;charset=utf-8
response body: 
<html><head><title>Apache Tomcat/5.5.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.apache.jasper.JasperException: Issue with id 'null' or key 'null' could not be found in the system
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.opensymphony.module.sitemesh.filter.PageFilter.writeDecorator(PageFilter.java:173)
	com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:158)
	com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
	com.atlassian.jira.web.filters.SitemeshExcludePathFilter.doFilter(SitemeshExcludePathFilter.java:38)
	com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:182)
	com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:181)
	com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:132)
	com.atlassian.jira.web.filters.JIRAProfilingFilter.doFilter(JIRAProfilingFilter.java:16)
	com.atlassian.jira.web.filters.ActionCleanupDelayFilter.doFilter(ActionCleanupDelayFilter.java:41)
	com.atlassian.jira.web.filters.RequestCleanupFilter.doFilter(RequestCleanupFilter.java:49)
	com.atlassian.johnson.filters.JohnsonFilter.doFilter(JohnsonFilter.java:91)
	com.atlassian.jira.web.filters.gzip.GzipFilter.doFilter(GzipFilter.java:68)
	com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:37)
	com.atlassian.jira.appconsistency.db.DatabaseCompatibilityEnforcerFilter.doFilter(DatabaseCompatibilityEnforcerFilter.java:25)
</pre></p><p><b>root cause</b> <pre>com.atlassian.jira.exception.IssueNotFoundException: Issue with id 'null' or key 'null' could not be found in the system
	com.atlassian.jira.web.action.issue.AbstractIssueSelectAction.getIssue(AbstractIssueSelectAction.java:89)
	com.atlassian.jira.web.action.issue.AbstractIssueSelectAction.getIssueObject(AbstractIssueSelectAction.java:347)
	com.atlassian.jira.web.action.issue.AbstractIssueSelectAction.getSummaryIssue(AbstractIssueSelectAction.java:367)
	org.apache.jsp.decorators.issuesummary_jsp._jspService(issuesummary_jsp.java:184)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.opensymphony.module.sitemesh.filter.PageFilter.writeDecorator(PageFilter.java:173)
	com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:158)
	com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
	com.atlassian.jira.web.filters.SitemeshExcludePathFilter.doFilter(SitemeshExcludePathFilter.java:38)
	com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:182)
	com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:181)
	com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:132)
	com.atlassian.jira.web.filters.JIRAProfilingFilter.doFilter(JIRAProfilingFilter.java:16)
	com.atlassian.jira.web.filters.ActionCleanupDelayFilter.doFilter(ActionCleanupDelayFilter.java:41)
	com.atlassian.jira.web.filters.RequestCleanupFilter.doFilter(RequestCleanupFilter.java:49)
	com.atlassian.johnson.filters.JohnsonFilter.doFilter(JohnsonFilter.java:91)
	com.atlassian.jira.web.filters.gzip.GzipFilter.doFilter(GzipFilter.java:68)
	com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:37)
	com.atlassian.jira.appconsistency.db.DatabaseCompatibilityEnforcerFilter.doFilter(DatabaseCompatibilityEnforcerFilter.java:25)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.20</h3></body></html>
Comment 19 David Green CLA 2007-09-13 13:26:54 EDT
The repository URL starts with https://
Comment 20 Steffen Pingel CLA 2007-09-13 13:39:00 EDT
It seems that we are not posting to the edit page expected by the repository. Just to make sure: the full repository URL should be https://portal.makesolutions.ca/jira/. If that is the case the repository is redirecting to to the same page so I am not sure how to fix that. 

Eugene, we should probably not only check for the 302 redirect code but also make sure the redirect location matches the one we expect in order to determine if a post was successful.



Comment 21 David Green CLA 2007-09-13 13:39:44 EDT
Created attachment 78354 [details]
the results of a post followed by a get, this time with the issue id specified in the get

Attached the results of a post, followed by a get to the specified Location, but this time with the issue id specified in the GET.

From what I can see there are some errors displayed on the page.  If you search for class="errMsg" in the results, there are several error messages there.  My guess is that these errors may be related to the previous POST, since when I try the same GET URL in my browser with the same issue id (but obviously without the same cookie and session) the error messages do not appear.
Comment 22 David Green CLA 2007-09-13 13:44:34 EDT
Created attachment 78357 [details]
My repository settings

As you can see in the attached screenshot, the repository URL is specified as https://portal.makesolutions.ca/jira
Comment 23 Steffen Pingel CLA 2007-09-13 13:54:41 EDT
(In reply to comment #21)
> From what I can see there are some errors displayed on the page.  If you search
> for class="errMsg" in the results, there are several error messages there.  My
> guess is that these errors may be related to the previous POST, since when I
> try the same GET URL in my browser with the same issue id (but obviously
> without the same cookie and session) the error messages do not appear.

I am not sure about that. The errors should not be persisted in the session. It looks more like a separate request which is lacking most fields. 

I am suspecting that something goes wrong with the URL. From the response headers it looks like the requests go through Apache and mod_jk which might mangle the URL in funny ways. It would be helpful if you could edit an issue through a web browser and take a look at the request/response headers.
Comment 24 David Green CLA 2007-09-13 16:04:36 EDT
Created attachment 78379 [details]
a screenshot of the browser-based request headers

I'm not sure if I agree with your assessment.  A successful edit redirects to the /jira/browse/ticket URI, whereas an edit submission with errors redirects to the /jira/secure/EditIssue.jspa URI.  

Find attached a screenshot of the request/response headers of a successful edit submission via browser.
Comment 25 Steffen Pingel CLA 2007-09-14 01:08:58 EDT
I have only verified with more recent versions of JIRA all of which behave as I described in comment 23. Take a look at this page for instance which displays a bunch of errors that are not a result of a post:

http://mylyn.eclipse.org/jira-enterprise-3.9/secure/EditIssue.jspa?id=13084

I could be that we pick up the wrong http://... repository URL when following the redirects during login resulting in the redirect to https://... when posting the issue update. Eugene the login redirects are traceable somehow, right?


Comment 26 Eugene Kuleshov CLA 2007-09-14 09:44:02 EDT
(In reply to comment #25)
> Eugene the login redirects are traceable somehow, right?

I am hesitating to add Eclipse tracing to jira.core to make it possible to use it as a standalone library.
Comment 27 Steffen Pingel CLA 2007-09-14 11:03:31 EDT
David, if you still have your Eclipse environment setup you can step through the code yourself. The login is done in JiraWebSession. If you set a break point in line 122 you should be able to tell from the url variable if you are being redirected to http. You can also set a break point in line 111 of JiraWebIssueService and check if baseUrl is correct.
Comment 28 Steffen Pingel CLA 2007-09-14 11:06:50 EDT
Also note this report which might have the same cause: bug 203052.
Comment 29 David Green CLA 2007-09-14 16:18:32 EDT
Good call on this one.  I've added some System.out logging of the login sequence code and here's what I see:

Opening an issue for edit (before the save) generates the following login sequence:

Login attempt 0 to https://portal.makesolutions.ca/jira/login.jsp
	 redirect location: http://portal.makesolutions.ca/jira/success
Login attempt 1 to http://portal.makesolutions.ca/jira/login.jsp
	 redirect location: https://portal.makesolutions.ca/jira/login.jsp
Login attempt 2 to https://portal.makesolutions.ca/jira/login.jsp
	 redirect location: http://portal.makesolutions.ca/jira/success

Pressing the submit button results in the following login sequence:

Login attempt 0 to https://portal.makesolutions.ca/jira/login.jsp
	 redirect location: http://portal.makesolutions.ca/jira/success
Login attempt 1 to http://portal.makesolutions.ca/jira/login.jsp
	 redirect location: https://portal.makesolutions.ca/jira/login.jsp
Login attempt 2 to https://portal.makesolutions.ca/jira/login.jsp
	 redirect location: http://portal.makesolutions.ca/jira/success

Looks like JIRA is incorrectly sending redirect locations that jump protocols back and forth.  I guess there are a few issues here:

- Any tips for users to correct this problem?  (Is it a misconfigured JIRA instance?)
- Mylyn should detect this problem and warn the user of a possible JIRA misconfiguration
- *maybe* Mylyn should always use the protocol specified in the repository settings.  At the very least, Mylyn should prevent information from going over HTTP if HTTPS is specified.
Comment 30 Eugene Kuleshov CLA 2007-09-14 16:22:38 EDT
BTW, do you have https or http in Mylyn's JIRA settings for your repository?
Comment 31 David Green CLA 2007-09-14 16:25:19 EDT
(In reply to comment #30)
> BTW, do you have https or http in Mylyn's JIRA settings for your repository?
> 

https.  See https://bugs.eclipse.org/bugs/show_bug.cgi?id=202834#c22 for more details.
Comment 32 Steffen Pingel CLA 2007-09-14 16:58:00 EDT
Thanks for debugging this.

> Login attempt 0 to https://portal.makesolutions.ca/jira/login.jsp
> redirect location: http://portal.makesolutions.ca/jira/success
> Login attempt 1 to http://portal.makesolutions.ca/jira/login.jsp
> redirect location: https://portal.makesolutions.ca/jira/login.jsp
> Login attempt 2 to https://portal.makesolutions.ca/jira/login.jsp
> redirect location: http://portal.makesolutions.ca/jira/success

It might be that your repository is configured with http but the web-server redirects to https. Could you contact your administrator to check the JIRA settings under Administration -> General Configuration: Base URL?

> - Any tips for users to correct this problem?  (Is it a misconfigured JIRA
> instance?)

See above. 

> - Mylyn should detect this problem and warn the user of a possible JIRA
> misconfiguration

I have been meaning to do that as part of the repository validation in the properties dialog: bug 186379 . I have scheduled it for the next release.

> - *maybe* Mylyn should always use the protocol specified in the repository
> settings.  At the very least, Mylyn should prevent information from going over
> HTTP if HTTPS is specified.

Yes, that needs to be checked. I didn't expect that potential misconfiguration of repositories could lead to redirects to http when implementing the login code.

Comment 33 Eugene Kuleshov CLA 2007-09-14 17:29:13 EDT
(In reply to comment #32)
> > - Mylyn should detect this problem and warn the user of a possible JIRA
> > misconfiguration
> I have been meaning to do that as part of the repository validation in the
> properties dialog: bug 186379 . I have scheduled it for the next release.

That sounds like a great idea. If we could detect those redirect and show a warning when validating repository settings.
Comment 34 David Green CLA 2007-09-14 18:13:46 EDT
No problem.  

Implementing repository integration via web form POSTing looks far more complicated/fragile than one would initially assume.  Kudos for getting it working.  I'm guessing that JIRA's XML-RPC interface is not sufficient for Mylyn's needs.  Perhaps that should be investigated as a more favorable integration strategy.

Just FYI, the JIRA base URL (in the JIRA settings on the server) is set to https://portal.makesolutions.ca/

I'll ask our IT guys to look into this problem further.

David


(In reply to comment #32)
> Thanks for debugging this.
> 
> > Login attempt 0 to https://portal.makesolutions.ca/jira/login.jsp
> > redirect location: http://portal.makesolutions.ca/jira/success
> > Login attempt 1 to http://portal.makesolutions.ca/jira/login.jsp
> > redirect location: https://portal.makesolutions.ca/jira/login.jsp
> > Login attempt 2 to https://portal.makesolutions.ca/jira/login.jsp
> > redirect location: http://portal.makesolutions.ca/jira/success
> 
> It might be that your repository is configured with http but the web-server
> redirects to https. Could you contact your administrator to check the JIRA
> settings under Administration -> General Configuration: Base URL?
> 
> > - Any tips for users to correct this problem?  (Is it a misconfigured JIRA
> > instance?)
> 
> See above. 
> 
> > - Mylyn should detect this problem and warn the user of a possible JIRA
> > misconfiguration
> 
> I have been meaning to do that as part of the repository validation in the
> properties dialog: bug 186379 . I have scheduled it for the next release.
> 
> > - *maybe* Mylyn should always use the protocol specified in the repository
> > settings.  At the very least, Mylyn should prevent information from going over
> > HTTP if HTTPS is specified.
> 
> Yes, that needs to be checked. I didn't expect that potential misconfiguration
> of repositories could lead to redirects to http when implementing the login
> code.
> 

Comment 35 Steffen Pingel CLA 2007-09-14 21:50:41 EDT
> Implementing repository integration via web form POSTing looks far more
> complicated/fragile than one would initially assume.  Kudos for getting it
> working.  I'm guessing that JIRA's XML-RPC interface is not sufficient for
> Mylyn's needs.  Perhaps that should be investigated as a more favorable
> integration strategy.

Thanks. The JIRA code is based on an external contribution that uses a mixed approach of SOAP and POSTing. We have spent significant amounts of time getting that to work across JIRA versions and the wide variety of repository configurations that are used. If anyone contributed a rewrite that supported the same feature set and was entirely based on SOAP or XML-RPC I would happily consider it as a replacement for all the HTML parsing and redirection handling code :).

> Just FYI, the JIRA base URL (in the JIRA settings on the server) is set to
> https://portal.makesolutions.ca/

Thanks for verifying. 

I'll consider bug 186379 for next week to hopefully get this issue fixed in time for 2.1.

Remaining to be done here:

- check redirect location returned after submit for correct URL

Comment 36 David Green CLA 2007-09-16 18:34:12 EDT
I sat next to our IT guy and we looked into our server setup in detail.  After some investigation this is what we discovered:

- our apache server on HTTP port 80 was configured to forward all requests to our secure server
- our apache server on HTTPS (port 443) was configured to talk to our Tomcat/JIRA instance using mod_jk and AJP/1.3

It was not easy to figure out, but the Tomcat side of the AJP connector was causing the problem as it was not propagating the fact that the connection was secure, nor the HTTPS connection port.  Thus the application itself thought that it was on HTTP port 80, and thus all returned 302 locations were to http port 80, which would of course be caught by our HTTP server forwarding back to the HTTPS instance, and thus we see the ping-pong forwarding behaviour.

So what we did to fix it is this: on our Tomcat server we configured the AJP/1.3 connector as follows:

<Connector port="8009" secure="true" proxyHost="portal.makesolutions.ca" proxyPort="443"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" /> 

This may be a bit "heavyweight", but it did the trick.

Thanks for spending so much time helping with this one.  Hopefully it'll help to improve Mylyn, and perhaps others can avoid such a problematic server configuration.
Comment 37 Steffen Pingel CLA 2007-09-16 20:17:04 EDT
Thank you for posting the results of the your configuration analysis, stepping through the code and all your feedback! It helped to uncover deficiencies in the redirect handling and status code verification of the JIRA connector which need to be addressed for the next release. 

I have added code to detect circular redirects that logs to the Eclipse error log. This should help to find the cause of similar problems more quickly in the future.

Eugene, I am leaning towards disabling following redirects during login entirely and to rely on the URL that was determined during validation. Do you thing that is feasible?
Comment 38 Steffen Pingel CLA 2007-09-16 22:49:29 EDT
Implemented checking of redirect locations. This needs testing.

Mik, could you please provide a dev build?
Comment 39 Steffen Pingel CLA 2007-09-16 22:49:36 EDT
Created attachment 78524 [details]
mylyn/context/zip
Comment 40 Eugene Kuleshov CLA 2007-09-17 00:35:50 EDT
Steffen, can you please put David's summary somewhere to the faq?
Comment 41 Mik Kersten CLA 2007-09-17 21:50:00 EDT
Wow, great detective work guys.  Dev build will be available within 2 hours.

 (In reply to comment #40)
> Steffen, can you please put David's summary somewhere to the faq?

David: if possible it would be best if you had a moment to do this, since the summary originated from you.  This should go into: http://wiki.eclipse.org/index.php/Mylyn_FAQ#Why_can.27t_I_connect.3F  
Comment 42 Steffen Pingel CLA 2007-09-17 23:51:02 EDT
I have added a reference to this bug here:

http://wiki.eclipse.org/index.php/Mylyn_FAQ#Why_do_I_get_errors_about_an_unexpected_redirect_when_submitting_an_issue.3F

David, feel free to edit that entry.
Comment 43 David Green CLA 2007-09-18 12:21:10 EDT
I've added some hints about the Tomcat server configuration to the wiki entry.
Comment 44 Steffen Pingel CLA 2007-09-18 19:31:55 EDT
Thanks!
Comment 45 David Green CLA 2008-04-08 14:13:17 EDT
I got hit by this one again with a new JIRA installation.  This time I had to also set the 'scheme' attribute on the connector configuration.

See http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html for AJP connector options.