Closed vkehayas closed 6 years ago
I'm unable to reproduce this bug, but I'd still like to get to the bottom of it. I've looked through our error logging system but didn't find anything relevant.
@vkehayas, can you confirm whether or not the stack trace in the browser console is the same in both cases you described (account and repo connected, or just account connected), and if not, provide a trace for the other case? Particularly, the first two lines after the TypeError
Also, would you mind emailing your project's GUID (the 5-character string after osf.io/
when viewing your project) to support@osf.io so that we can investigate if the project's state is related?
Thank you for your prompt response.
After I disabled and re-enabled GitLab I was able to browse my files before selecting a GitLab repo and the stack trace was clean. After selecting a GitLab repo, I got the same trace as before. I realize that de-selecting the repo has no effect - upon page refresh the same repo is selected. I guess selecting ----
is not a valid option once you 've selected a repo.
I've sent an email with my GUID, as instructed.
Thanks, @vkehayas. I've diagnosed the bug, I expect we'll have a fix out later today. I'll keep this issue open until it's deployed
Thanks @mfraezz for the fix.
@vkehayas The fix is now deployed. Can you please verify that the issue is fixed?
No, sorry, I still get similar output.
jquery.min.js:2 jQuery.Deferred exception: Cannot read property 'branch' of undefined TypeError: Cannot read property 'branch' of undefined at o (https://osf.io/static/public/js/gitlab/files.8c0a241b61af243e576d.js:1:276) at n.s (https://osf.io/static/public/js/gitlab/files.8c0a241b61af243e576d.js:1:1156) at https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:12:3405 at Array.map (native) at https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:12:2989 at Array.map (native) at Object.m.view (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:12:1864) at Object.i [as view] (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:10:14496) at m (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:10:14809) at Function.r.redraw (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:10:21166) at n.refreshRange (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:11:23788) at n.calculateVisible (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:11:23521) at https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:11:22169 at i (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:28017) at Object.add [as done] (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:28316) at n.toggleFolder (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:11:21076) at n.updateFolder (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:11:20706) at n.q (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:19:13248) at n.ondataload (https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:20:532) at https://osf.io/static/public/js/vendor.5cdfb267d6a9e799e7c5.js:11:14315 at i (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:28017) at fireWith (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:28783) at j (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:30283) at k (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:30313) at c (https://osf.io/static/vendor/bower_components/raven-js/dist/raven.min.js:2:3899) undefined
However, looking at https://github.com/CenterForOpenScience/osf.io/commit/b7c494ed1148cc69597054a4e5189852e33b63e8 I realized that the problem seems to be that my repo is inside a nested folder (a "group" in GitLab's terminology). Indeed, I created a test repository that is at the top of the tree (i.e. gitlab.com/username/repo instead of gitlab.com/username/group/repo) and the sync with osf.io was successfull. Of course, GitLab allows for more than one levels of grouping and I do not expect you to support that feature, so let me know if a single group level is possible to parse without too much effort or not and I'll adjust the organization of my repos accordingly.
I still got some apparently innocuous errors in the console - probably nothing to worry about:
raven.js:695 GET https://files.osf.io/v1/resources/{GUID}/providers/gitlab/?branch=&meta=&_=1513283374168 400 (Bad Request) (anonymous) @ raven.js:695 D @ mithril.js:1086 r.request @ mithril.js:1142 i.request @ treebeard.js:43 (anonymous) @ treebeard.js:1050 i @ jquery.min.js:2 add @ jquery.min.js:2 toggleFolder @ treebeard.js:1046 onclick @ treebeard.js:2319 (anonymous) @ mithril.js:482
(EDIT: Redacted GUID)
@vkehayas Thanks for digging into that and for the thorough report. We'll evaluate what it will take to support repos within groups within the next week. Thanks for your patience!
@vkehayas OK, we released a fix that should allow repos within groups. Can you verify that you can connect your repo(s)?
Perfect! Repos up to at least two levels-deep in the tree work, as well as those at the top of the tree. Thanks a lot to all of you for your efforts and patience.
Great! Thanks for reporting the issue and for your patience while we fixed it.
After I enabled the GitLab add-on, the file browser stopped displaying my files. I only see a spinning wheel next to my projects name (see screenshot). Everything works fine if I disable the add-on by disconnecting the account but not if I do not select any GitLab repository. The issue appears in both Chrome and Firefox with no plugins/extensions enabled. Here are the errors from the console in Chrome:
Apparently, osf is unable to access the branch property. I have given osf full access to the GitLab api (api scope). Please let me know how I could provide more info if needed.