-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Error when logging in to Wekan REST API when using Sandstorm Wekan #1279
Comments
I noticed that the Python script pulls from Selenium. I get the impression he is actually instructing Selenium to open the full Wekan grain and operating it in an automated fashion. It's definitely vastly preferable to query the API. This is probably the documentation you're looking for, if you haven't seen this already: https://docs.sandstorm.io/en/latest/developing/http-apis/ |
It looks like it last worked on 9/1/2017 and after the credentials were put in it was showing the full json text data of the wekan board and the subsequent steps parsed that json data. The error:
Is related to the parser not finding what it is expecting to start the parsing. Any ideas to navigate to the json data should fix this problem. Please let me know and I will update my code. I am trying a few different paths to see if I can figure out a way to get back to the json data with card titles etc. I would like all the board data if possible for the export. @ocdtrekkie - I am just instructing Selenium to open the URL. Once the page loads I grab the background data and immediately close the browser: `browser2 = Browser('chrome') browser2.visit(apiURLnoAuth) # Fill in the url sleep(1) #Time in seconds soup = BeautifulSoup(browser2.html,'html.parser') Once the data is assigned to the 'soup' variable, I am done with Selenium. |
There is already a way to Import and Export Wekan board to and from JSON at Sandstorm Wekan, when you click board menu (hamburger icon, 3 lines) and click there Import or Export. But I don't know how to do this with API. Trello import on Sandstorm Wekan does not import attachments yet, because Wekan does not have Sandstorm compatible access to outside of grain. Importing Trello attachments works on Standalone Wekan (like Docker etc) and then you can export Wekan JSON that includes attachments in JSON as Base64 encoded, and then import that Wekan JSON to Sandstorm with attachments in JSON. |
@xet7 - This appears to be broken as well in Sandstorm. The download starts, but fails 'Failed - Server problem' while download backup on Sandstorm continues to work. On 9/1/2017 and earlier, visiting the API URL had the export data readily available and that was what the script I wrote was parsing. |
What version of Wekan you have on Sandstorm? Have you updated to latest? I have 0.47.0 When updating, also update all your grains. Please include your Sandstorm Wekan grain console logs so I can see exact errors. |
Version: 0.47.0 ** SANDSTORM SUPERVISOR: Grain shutdown requested. |
Is it only error with this Wekan grain? Can you export some other Wekan grain? |
It is only happening to the one board. Other wekan grains are exporting json correctly. |
I added this info to Wekan wiki Exporting Wekan board to JSON file with Bash script
|
It seems like you're successfully doing the things you need to do on Sandstorm to talk to a grain API. The errors are coming from Wekan, not Sandstorm. With that said, it's likely that you'll want to change the way the Wekan API is authorized on Sandstorm. Sandstorm will automatically add headers to the API requests identifying the user -- the same headers it adds to all HTTP requests. https://docs.sandstorm.io/en/latest/developing/auth/#headers-that-an-app-receives The |
As far as trying the Wekan API, I am not having any luck using the links through Sandstorm. The only thing that has worked was the export URL thus far. I am betting the directory structure inhibits the normal API request functions, however I am a bit green on API testing and might be missing something. |
I added a bounty to this issue to try to get links made for the API that also work in Sandstorm. Only the export link works and that is not part of the API: https://github.com/wekan/wekan/wiki/REST-API Bounty page: |
I think I could try to fix this by exposing /api at sandstorm-pkgdef.capnp file when I get some free time. |
Wish I had the setup and understanding to do these changes myself. Any idea on timeline? |
No idea. Maybe in near or distant future. |
Following up on this one. I have reached out to xet7 to assist and he is having trouble with his sandstorm based building VM. If anyone has a working development environment to test the REST API for sandstorm version and build from it to get it to production please let me know, I would like to get this feature as soon as possible. |
As you can see from these IRC chatlogs, only @kentonv is currently able to build Sandstorm from source, because he made changes how Sandstorm was built: I don't know are there pull request to documentation yet. I also have not yet figured out all steps yet. |
Probably these fixes to build script were recently merged: |
Add new issue to Sandstorm if you still have problems: |
And also add info to this issue if you get Sandstorm built, and how you did it. |
I added issue to Sandstorm, I still have problems. |
Install instructions included at Sandstorm repo should now work also for you. So you can clone that repo and follow instructions. It should work OK. |
Requirements:
|
Can you test:
|
While I do backup nightly, I am not in a position where I can comfortably restore the exact same version of my environment if I upgrade and I fear change like most without thorough testing. There is already a way to test on Sandstorm's Oasis. If no changes were made to the API structure in wekan or sandstorm, I believe this bug will persist. I did a test below, however I am not super confident of my formatting for API requests in sandstorm apps other than the already working export API get request. I tested again, not that I really know how the format should go in Sandstorm for user addition, but I tried this and got a 'Bad Request' for user add while I was able to confirm export was still working: import requests APIBegURL = 'https://Bearer:nS_0nDcc63vZ9QWpuNCkPK5BBMGLDiLxP-0JNhVKz79@api-a5587d9539ca906a2aa5e1eebc7dac89.oasis.sandstorm.io' Commands#Confirm API still works for exporting entire board #Bad Request Result for User Addition |
@ertanalytics Did you test with 1.33 on Oasis or 1.34? |
Version 1.33.0~2018-08-16 @ocdtrekkie |
Please test Wekan Sandstorm version v1.39, it has speedups, does it help enough with performance? |
Also, since you tested with the pre-SandstormApi change version, test out the API too and let me know if it behaves differently. I wanted to do some testing myself but I've been really busy of late and don't know how much time I have to devote to side projects at the moment. |
@xet7 , it is more about the API not working than performance. I have not noticed a performance increase with the update. My larger, more used board, takes about 23 seconds to respond when you click on the browser to view from being in the background. It is 20.8 MB board on Sandstorm. @ocdtrekkie , I have updated to version 1.39 of Wekan on Sandstorm, updated Sandstorm with Dev channel and now the board export API above no longer works. Other API calls continue to not work. I get status OK response, but it just gives me the same response text no matter what API commands I put in: |
Export using Wekan board hamburger menu / Export still works, so API is enabled on on Wekan side. I know this, because if at Standalone Wekan WITH_API=false, Exporting board at Wekan menu does not work, but gives similar HTML output like you have above. That settings WITH_API=true is at code here: I don't know what effect did addition of /api by @ocdtrekkie do: Does Sandstorm API still work? Or did some update disable it? |
I only tested at sandstorm.io though. I'll test at something.sandcats.io next. |
I tested something.sandcats.io , created webkey etc, it's the same. Export using API does not work. Export using Wekan menu does work. Something prevents calling API. |
Hm..... what if you remove the /api from your request URL, @xet7? I'm wondering if setting apiPath to /api makes it add it to the URL, which would be /api/api. If this is true, we can change the apiPath to / to fix this. |
/api/api and /api/api/api did not work yet in rest api. I try modifying sandstorm-pkgdef.capnp file. |
Thanks to ocdtrekkie and xet7 ! Related #1279
To clarify, I had meant to tell you to try the request WITHOUT the part of the URL, as I think my change is adding it.
…Sent from my Windows 10 phone
From: Lauri Ojansivu
Sent: Tuesday, September 4, 2018 5:57 PM
To: wekan/wekan
Cc: Jacob Weisz; Mention
Subject: Re: [wekan/wekan] Error when logging in to Wekan REST API when usingSandstorm Wekan (#1279)
@ocdtrekkie
/api/api and /api/api/api did not work. I try modifying js file.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Will this commit be in an experimental version or on Oasis or somewhere I can test outside of my environment? |
My understanding is that the change xet7 made to un-break this is in the current version of Wekan, which I've approved to the app market. Note that before packages are approved, they can be found at https://apps.sandstorm.io/?experimental=true |
Wekan is at official store, without ?experimental=true in url. I think there is no experimental currently. If official also does not work, it's more likely Sandstorm bug. @kentonv What do you think? |
I still don't think there's any Sandstorm bugs with the API at present. I don't think the API has ever worked really correctly on the Sandstorm version. @ertanalytics When there's no experimental app available, the experimental market stays on "loading". It's a known issue with the market because the experimental market is kinda a hack. sandstorm-io/sandstorm-app-market#98 |
After running the same tests, I received the same bad response for the test response in the latest version on Oasis. Below is the testing method in Python 3.6.5 with requests package version number 2.18.4 on Oasis Wekan version 1.49.0-2018-09-17 tested 9/28/2018. `import requests #https://api-ec9e7c51610a73ebf1e11001caf8b1dd.oasis.sandstorm.io#L92rf5G3B3rIsk8Z1USnnM-6ZjbRFugyWZWCaxP4iDt #Confirm API still works for exporting entire board #Bad Request Result for User Addition |
I got API working in Wekan release I will make soon. API works this way:
curl http://Bearer:[email protected]:6080/api/boards/sandstorm/export?authToken=#APIKEY > wekanboard.json
|
- [Fix Error when logging in to Wekan REST API when using Sandstorm Wekan](#1279). Sandstorm API works this way: Make API key, and from that key copy API URL and API KEY to below. It saves Wekan board to file. `curl http://Bearer:[email protected]:6080/api/boards/sandstorm/export?authToken=#APIKEY > wekanboard.json` If later API key does not work, you need to remove it and make a new one. Thanks to xet7 !
Verified the export does show data again. The other API features do not appear to work including the user addition example, but at least the export is working again with the API. |
@kentonv
The problem is, on Standalone Wekan I can login to Wekan REST API using Wekan username and password, but on Sandstorm Wekan when I login with Google Auth, I get error with Sandstorm Webkey when I use Webkey as password. I don't know what other password I would use.
I tried this way:
https://github.com/wekan/wekan/wiki/Wekan-Sandstorm-cards-to-CSV-using-Python
Sure by using Python BeautifulSoup etc Wekan html and javascript could probably be parsed and used like in code above, but using REST API would be much nicer.
BTW @ertanalytics when I tried to use your code this way:
And copied chromedriver from https://sites.google.com/a/chromium.org/chromedriver/home to my /usr/bin , I got this error, do you know solution to it?
Using Wekan REST API on Sandstorm could make easier:
Is there some documentation how with Meteor app like Wekan it would be possible to access info outside of grain, for example so that when importing attachments from Trello, some Sandstorm-compatible way could be used to download Trello attachments to Wekan?
I have not yet tried could EtherCalc API also be used on Sandstorm.
The text was updated successfully, but these errors were encountered: