Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Not saving configuration #116

Closed
mickburgs opened this issue May 12, 2016 · 26 comments
Closed

Not saving configuration #116

mickburgs opened this issue May 12, 2016 · 26 comments
Labels

Comments

@mickburgs
Copy link

Using plugin version 2.19 and Bitbucket v4.1.3.

After installing the plugin i configured this plugin with some triggers.
Now i am trying to remove the trigger on 'COMMENTED' but the plugin doesnt seem to save my edited configurations and still triggers on comments.

Also, when i open the configuration page all fields are blank.
Not seeing any errors in browser when clicking the save button after editing the configurations.
Did not see any errors in log file.

@mickburgs
Copy link
Author

Reinstalling the plugin doesnt reset configurations either

@tomasbjerre
Copy link
Owner

What browser are you using? I have only tested it with Chrome.
If you are using Chrome, can you see something in Developer Tools console? (by pressing F12).

tomasbjerre added a commit that referenced this issue May 12, 2016
 * Found JS that may crashes in IE9. #116
@tomasbjerre
Copy link
Owner

I released 2.20 with a small Javascript change thay may have caused crash in IE9. I dont have such an installation so cannot be sure that was the problem here.

@mickburgs
Copy link
Author

I am using Chrome aswell so that can't be the problem.
Where does the plugin store its configuration in the database?
So i can update the configuration through there for now

@tomasbjerre
Copy link
Owner

The storage key is:
se.bjurr.prnfb.pull-request-notifier-for-bitbucket-3

I dont know more about where they end up in the database.

Did you upgrade from an earlier versio when you encountered this problem?
Den 13 maj 2016 12:18 skrev "mickburgs" [email protected]:

I am using Chrome aswell so that can't be the problem.
Where does the plugin store its configuration in the database?
So i can update the configuration through there for now


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#116 (comment)

@mickburgs
Copy link
Author

No, i installed the plugin and was able to set the configuration once.
No it is stuck in this configuration and i am unable to edit it.

@tomasbjerre
Copy link
Owner

If you use Chrome and developer tools (F12). You should see a call to /bitbucket/rest/prnfb-admin/1.0/settings/notifications when save button is pressed. You may look at the response of that call and see if the triggers are changed or not. To find out if the problem is in the backend or frontend.

@mickburgs
Copy link
Author

I get no response to that call.
But when i try to update the configurations with no triggers, it responses with: se.bjurr.prnfb.settings.ValidationException: triggers=At least one trigger must be selected.

@tomasbjerre
Copy link
Owner

Yes, that is intended. Without any triggeres checked, its gonna be impossible to trigger the notification. You have to check another trigger, or delete the notification.

@mickburgs
Copy link
Author

I understand that. I was only trying to clearify that i do get a response when setting no triggers but dont get any when i do set them.

@tomasbjerre
Copy link
Owner

I added some examples with Curl to the readme. If you try them on you installation, what do they return?

@tomasbjerre
Copy link
Owner

I added integration tests for REST API and found the problem. Missing annotations, not specifying consuming content type of resources. Will release fix in 2.21.

@cdancy
Copy link

cdancy commented May 18, 2016

Issue is still happening with 2.21 and using bitbucket 4.6.0 (docker image).

After saving the configuration for a given repo, and then refreshing the page, all the saved info is gone. Any ideas? Any info I can provide to help test/debug?

@tomasbjerre tomasbjerre reopened this May 18, 2016
@tomasbjerre
Copy link
Owner

There are some examples with curl in the readme. Do they work for you? Can you use them to create a notification?

@tomasbjerre
Copy link
Owner

Using Chrome. You may hit F12, view network tab, press save for a notification, right click on the request in the network field, copy as curl, paste it here.

@cdancy
Copy link

cdancy commented May 18, 2016

@tomasbjerre ran this curl command:

curl -vv -u root:root 'http://192.168.1.127:7990/rest/prnfb-admin/1.0/settings/notifications' -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' --data-binary '{"uuid":"","name":"","projectKey":"TES","repositorySlug":"","filterString":"","filterRegexp":"","triggers":["COMMENTED"],"injectionUrl":"","injectionUrlRegexp":"","user":"","password":"","proxyUser":"","proxyPassword":"","proxyServer":"","proxyPort":"","url":"http://localhost:80/?abc","method":"GET","postContent":"","headers":[{"name":"","value":""}]}'

and got the below for the result. Everything appears to be fine but visiting the config page everything is empty.

    *   Trying 192.168.1.127...
* Connected to 192.168.1.127 (192.168.1.127) port 7990 (#0)
* Server auth using Basic with user 'root'
> POST /rest/prnfb-admin/1.0/settings/notifications HTTP/1.1
> Host: 192.168.1.127:7990
> Authorization: Basic cm9vdDpyb290
> User-Agent: curl/7.43.0
> Content-Type: application/json; charset=UTF-8
> Accept: application/json, text/javascript, */*; q=0.01
> Content-Length: 353
>
* upload completely sent off: 353 out of 353 bytes
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< X-AREQUESTID: @9M4XVFx997x1722x0
< X-ASEN: SEN-L7893295
< X-AUSERID: 1
< X-AUSERNAME: root
< X-Content-Type-Options: nosniff
< Content-Type: application/json
< Transfer-Encoding: chunked
< Vary: Accept-Encoding
< Date: Wed, 18 May 2016 16:37:26 GMT
<
* Connection #0 to host 192.168.1.127 left intact

@tomasbjerre
Copy link
Owner

Are you able to view logs? There are logging from SettingsService that is a bit interesting here. It should log when it finds no settings and looks for legacy settings.

@tomasbjerre
Copy link
Owner

tomasbjerre commented May 18, 2016

If you browse to /rest/prnfb-admin/1.0/settings/notifications you get an empty list as response?

I tried the docker image now, it works for me.

@cdancy
Copy link

cdancy commented May 18, 2016

This is what I get returned from that endpoint:

[{"headers":[],"method":"POST","name":"Notification","password":"root","projectKey":"TES","repositorySlug":"dev","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["OPENED"],"url":"http://192.168.1.127:7990/rest/api/latest/queue/TEST-BIT?executeAllStages=true&bamboo.PR=true","user":"root","uuid":"269d3c12-692b-4650-a8fc-e6ca50961ab0"},{"headers":[],"method":"POST","name":"Notification","password":"root","projectKey":"TES","repositorySlug":"dev","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["APPROVED","OPENED","BUTTON_TRIGGER","UPDATED"],"url":"http://192.168.1.127:32775/rest/api/latest/queue/TEST-BIT?executeAllStages=true&bamboo.PR=true","user":"root","uuid":"46c46670-ab89-4ddc-b7aa-88978dc28197"},{"headers":[],"method":"POST","name":"Notification","password":"root","projectKey":"TES","repositorySlug":"dev","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["APPROVED","COMMENTED","OPENED","UPDATED"],"url":"http://192.168.1.127:32775/","user":"root","uuid":"06d15348-11fe-4ef0-86fb-93a5bffcb5f0"},{"headers":[],"method":"GET","name":"Notification","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"2bb4063d-54dc-424d-84ee-51956040b017"},{"headers":[],"method":"GET","name":"Notification","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"a1fd3f4e-26ec-4d5e-8f98-7272cf02f31a"},{"headers":[],"method":"GET","name":"Notification","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"dfaa2488-5c36-4036-a9e9-aa37896ac77e"},{"headers":[],"method":"GET","name":"Notification","projectKey":"TES","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"4445b829-e402-4a45-a2d2-3b5fbde18c2a"},{"headers":[],"method":"GET","name":"Notification","projectKey":"TES","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"78e51bfd-5c6a-4975-847b-19cfe240a7b1"},{"headers":[],"method":"GET","name":"Notification","projectKey":"TES","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"0c703664-fb5d-4fa5-b806-cae6fe205675"},{"headers":[],"method":"GET","name":"Notification","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"60c26f3b-537f-432b-b6bd-11ca0e84c2da"},{"headers":[],"method":"GET","name":"Notification","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"5a0a8c06-a5cc-48a1-a16c-1c6f09364458"},{"headers":[],"method":"GET","name":"Notification","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["COMMENTED"],"url":"http://localhost:80/?abc","uuid":"ad97887d-2f09-4dba-ba9a-ffe6f9271f1d"}]

@cdancy
Copy link

cdancy commented May 18, 2016

Also not seeing anything from this plugin within the logs.

@tomasbjerre
Copy link
Owner

Then they are saved =)

The notification dropdown here:
skarmbild fran 2016-05-18 20 54 45

It contains nothing except "new"?

@cdancy
Copy link

cdancy commented May 18, 2016

It is there. I assumed for a given job there would be 1 way of configuring things and so didn't think to look for a drop down list. Because of that I assumed the last thing I saved would be the first thing displayed when going back to this page.

My apologies for re-opening the issue. The latest release does appear to solve this problem. Thanks for walking through things with me.

@tomasbjerre
Copy link
Owner

No problem =)

@bmmgit
Copy link

bmmgit commented May 18, 2018

curl "http://localhost:7990/plugins/servlet/xproduct/admin?name=bhagya&time=10"%"3A30" -H "Accept-Encoding: gzip, deflate, sdch" -H "Accept-Language: en-US,en;q=0.8" -H "Upgrade-Insecure-Requests: 1" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8" -H "Referer: http://localhost:7990/plugins/servlet/xproduct/admin?name=dcdff&time=fdsfszfsf" -H "Cookie: net.seibertmedia.linchpin.sidebar.state=opened; jira.editor.user.mode=wysiwyg; confluence.list.pages.cookie=list-content-tree; confluence.browse.space.cookie=space-blogposts; confluence.last-web-item-clicked=system.space.tools"%"2Fintegrations"%"2Fapplinks-configure-entity-links-2; _ga=GA1.1.528227536.1516776908; AJS.conglomerate.cookie=""|hipchat-invite-visited=true|COOKIES_ARE_COOL=not true""; JSESSIONID=C9CC51F341CE2CEE5DC56F60FF837A20; atlassian.xsrf.token=BS1P-LMMI-OXUD-NGW6|74eb90d84a44b73176d1c4d2445b28025df65277|lin; _atl_bitbucket_remember_me=NTM0ZDUwN2QwNmU3NmE3OTAxNGIyMzFmNDI2ZTJkMDI2MDk2NTE3OTplYTA4NTYzZGJkMzEwZWE4M2ZiYWVkNTAwMzQyOTk2M2YwYjNjMTVk; BITBUCKETSESSIONID=BC442482940BC65BA24EAA686813D7DD" -H "Connection: keep-alive" --compressed

@bmmgit
Copy link

bmmgit commented May 18, 2018

hi tomasbjerre,

I have tried with the plugin in bitbucket using below URL "https://developer.atlassian.com/server/framework/atlassian-sdk/creating-an-admin-configuration-form/" The plugin is not saving any configuration data when i press the button save.
Please assist ASAP.

@bmmgit
Copy link

bmmgit commented May 18, 2018

only json data am getting in the chrome is: {"time":0} this is after entering the value in the configuration form.
notification i have getting below information .

404

null for uri: http://localhost:7990/rest/xproduct-admin/1.0/settings/notifications

please assist because nothing is saved in the configuration form in bitbucket

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

No branches or pull requests

4 participants