You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot store pull requests for a repository that hasn't been inserted into the database #3568
Not sure what is this even try to do? Is it trying to fetch something from GitHub API? Does it even have access to do so?
Oh, this is it. This is happening only for private repos. Now that I think, I do not remember GitHub Desktop ever asking me for any authentication to login or something.
Oh, this is it. This is happening only for private repos. Now that I think, I do not remember GitHub Desktop ever asking me for any authentication to login or something.
I think this is related to how we're handling remotes. Is it configured with a HTTPS or SSH remote?
The credential provider inside Desktop uses GIT_ASKPASS to handle credentials - if you can't push or pull to your private repository and it's HTTPS ensure you are signed in. I also think need you to sign in for the API lookups around pull requests.
@iAmWillShepherd any other thoughts on why it might end up in this state?
@mitarGIT_ASKPASS is just how Desktop authenticates for HTTPS remotes (this is ignored for SSH remotes).
Are you signed into the app? I think that's the missing piece, but doesn't explain why it's trying to resolve pull requests when you're not signed in (it shouldn't care).
I see quite some errors in the error log. Some seems unrelated.
2017-12-11T09:48:27.075Z - info: [ui] [AppStore] adding repository at /<redacted>/servers to store
2017-12-11T09:48:27.439Z - warn: [ui] fetchRepository: '<redacted>/servers' returned a 404
2017-12-11T09:48:27.495Z - warn: [ui] Unable to fetch issues for <redacted>/servers
Error: Cannot get issues for a repository that hasn't been inserted into the database!
at Object.n [as fatalError] (/home/mitar/webpack:/external "path":1:1)
at t.IssuesStore.getLatestUpdatedAt (/home/mitar/webpack:/app/src/lib/stores/issues-store.ts:29:24)
at t.IssuesStore.fetchIssues (/home/mitar/webpack:/app/src/lib/stores/issues-store.ts:66:5)
at te._updateIssues (/home/mitar/webpack:/app/src/lib/stores/app-store.ts:825:6)
at te._selectRepository (/home/mitar/webpack:/app/src/lib/stores/app-store.ts:781:11)
at t.Dispatcher.selectRepository (/home/mitar/webpack:/app/src/lib/dispatcher/dispatcher.ts:166:4)
at addRepository (/home/mitar/webpack:/app/src/ui/add-repository/add-existing-repository.tsx:185:3)
at <anonymous>
2017-12-11T09:48:27.620Z - warn: [ui] fetchAll: 'repos/<redacted>/servers/pulls?state=open' returned a 404
2017-12-11T09:48:27.621Z - warn: [ui] Error refreshing pull requests for 'servers'
Error: Cannot store pull requests for a repository that hasn't been inserted into the database!
at Object.n [as fatalError] (/home/mitar/webpack:/external "path":1:1)
at t.PullRequestStore.writePRs (/home/mitar/webpack:/app/src/lib/stores/pull-request-store.ts:179:17)
at t.PullRequestStore.refreshPullRequests (/home/mitar/webpack:/app/src/lib/stores/pull-request-store.ts:51:7)
at <anonymous>
2017-12-11T09:48:27.753Z - warn: [ui] fetchRepository: '<redacted>/servers' returned a 404
2017-12-11T09:48:27.810Z - warn: [ui] fetchCommit: 'repos/<redacted>/servers/commits/<redacted>' returned a 404
2017-12-11T09:48:27.812Z - warn: [ui] fetchCommit: 'repos/<redacted>/servers/commits/<redacted>' returned a 404
2017-12-11T09:48:27.813Z - warn: [ui] fetchCommit: 'repos/<redacted>/servers/commits/<redacted>' returned a 404
2017-12-11T09:56:16.897Z - error: [ui] Could not load old contents for syntax highlighting
Error: Git returned an unexpected exit code '128' which should be handled by the caller.'
at ChildProcess.s.on (/home/mitar/webpack:/app/src/lib/git/spawn.ts:88:15)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:510:12)
2017-12-11T09:56:16.900Z - error: [ui] Could not load new contents for syntax highlighting
Error: EISDIR: illegal operation on a directory, read
2017-12-11T09:58:27.874Z - warn: [ui] fetchAll: 'repos/<redacted>/servers/pulls?state=open' returned a 404
2017-12-11T09:58:27.879Z - warn: [ui] Error refreshing pull requests for 'servers'
Error: Cannot store pull requests for a repository that hasn't been inserted into the database!
at Object.n [as fatalError] (/home/mitar/webpack:/external "path":1:1)
at t.PullRequestStore.writePRs (/home/mitar/webpack:/app/src/lib/stores/pull-request-store.ts:179:17)
at t.PullRequestStore.refreshPullRequests (/home/mitar/webpack:/app/src/lib/stores/pull-request-store.ts:51:7)
at <anonymous>
2017-12-11T10:05:00.618Z - error: [ui] Could not load old contents for syntax highlighting
Error: Git returned an unexpected exit code '128' which should be handled by the caller.'
at ChildProcess.s.on (/home/mitar/webpack:/app/src/lib/git/spawn.ts:88:15)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:510:12)
2017-12-11T10:05:00.623Z - error: [ui] Could not load new contents for syntax highlighting
Error: EISDIR: illegal operation on a directory, read
2017-12-11T10:05:12.666Z - error: [ui] Could not load old contents for syntax highlighting
Error: Git returned an unexpected exit code '128' which should be handled by the caller.'
at ChildProcess.s.on (/home/mitar/webpack:/app/src/lib/git/spawn.ts:88:15)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:510:12)
2017-12-11T10:05:12.674Z - error: [ui] Could not load new contents for syntax highlighting
Error: EISDIR: illegal operation on a directory, read
In "Options" it looks like I am (I see my account and avatar).
Ok cool, that explains why it's trying to resolve pull requests. Digging into that log file, I can see some interesting groups of issues:
2017-12-11T09:48:27.495Z - warn: [ui] Unable to fetch issues for <redacted>/servers
Error: Cannot get issues for a repository that hasn't been inserted into the database!
...
2017-12-11T09:48:27.621Z - warn: [ui] Error refreshing pull requests for 'servers'
Error: Cannot store pull requests for a repository that hasn't been inserted into the database!
If the repositories aren't being inserted correctly into the IndexedDB databases that Electron offers for apps, that would explain these errors. Does the application forget your tracked repositories when you restart it? We should have some tracing here but I'm not sure how detailed it is.
2017-12-11T09:56:16.900Z - error: [ui] Could not load new contents for syntax highlighting
Error: EISDIR: illegal operation on a directory, read
...
2017-12-11T10:05:00.618Z - error: [ui] Could not load old contents for syntax highlighting
Error: Git returned an unexpected exit code '128' which should be handled by the caller.'
I tested this out on Fedora 16.04 and didn't spot any issues. I'm not going to focus on this for now, as the inconsistent errors here look to be environmental.
I am using a compiled GitHub Desktop on Linux from master branch.
It's not clear to me whether you are running this in development mode yarn start or production mode yarn build:prod && yarn start:prod. Also, it's not clear which distribution of Linux you are running here.
Does the application forget your tracked repositories when you restart it?
No. If I restart the app it loads the list of the repositories in the sidebar as it was before.
I'm not going to focus on this for now, as the inconsistent errors here look to be environmental.
I have not seen in UI any issues with diffing. So I agree we leave this be for now.
It's not clear to me whether you are running this in development mode yarn start or production mode yarn build:prod && yarn start:prod. Also, it's not clear which distribution of Linux you are running here.
I made a production webpack package and I am using that. I could try running it in some other way if it would be helpful. I am using Linux Ubuntu 17.10.
@shiftkey, I've had these issues before, but that's only while in the middle of development.
The way I got into this state was to modify one of the databases and reload the app. So one thing I'd recommend is to try deleting all the databases in the app. If after doing that and reloading the app, the issue still persists, we can rule that out as a possible cause.
@mitar , can you give this a shot? Just open Dev Tools located under the View top bar menu and go to Application -> IndexedDB -> [databases] and delete each one, then delete local storage and restart the app.
I made a production webpack package and I am using that. I could try running it in some other way if it would be helpful. I am using Linux Ubuntu 17.10.
Sorry. I got confused here. I had in mind appimage, not webpack. But now I realized this is not what I am really running at the moment (I tried multiple things and it didn't work for me). In fact I made a Debian package and installed that and I am using it. Same as what I described here.
So there is no special changes to the config. I just built it and installed it.
@mitar can you try the workaround that @iAmWillShepherd suggested about removing the databases and then try re-adding the repository? If that works we can then look into the trickier issues.
I'm going to recommend downloading the release candidate I link to in #1525 (comment) and validating the issue is reproducible there. If it is, please resubmit this (with repro steps and details) to my fork.
Activity
joshaber commentedon Dec 11, 2017
That's interesting! Could you provide the exact steps you took to get this? Does it happen every time you add a repository?
mitar commentedon Dec 11, 2017
Yes, it happens every time.
I do not see any special steps to do. Literally just "add a local repository", I select it and confirm, and this error shows.
joshaber commentedon Dec 11, 2017
I haven't been able to reproduce this on Mac. May be Linux-specific somehow.
mitar commentedon Dec 11, 2017
Not sure what is this even try to do? Is it trying to fetch something from GitHub API? Does it even have access to do so?
Oh, this is it. This is happening only for private repos. Now that I think, I do not remember GitHub Desktop ever asking me for any authentication to login or something.
mitar commentedon Dec 11, 2017
Is it maybe a problem that I copied
github_rsaandgithub_rsa.pubfrom my old computer?shiftkey commentedon Dec 11, 2017
I think this is related to how we're handling remotes. Is it configured with a
HTTPSorSSHremote?The credential provider inside Desktop uses
GIT_ASKPASSto handle credentials - if you can't push or pull to your private repository and it'sHTTPSensure you are signed in. I also think need you to sign in for the API lookups around pull requests.@iAmWillShepherd any other thoughts on why it might end up in this state?
mitar commentedon Dec 11, 2017
They are SSH remotes. I do not have
GIT_ASKPASS(environment variable, I presume) set.shiftkey commentedon Dec 11, 2017
@mitar
GIT_ASKPASSis just how Desktop authenticates for HTTPS remotes (this is ignored for SSH remotes).Are you signed into the app? I think that's the missing piece, but doesn't explain why it's trying to resolve pull requests when you're not signed in (it shouldn't care).
mitar commentedon Dec 11, 2017
I see quite some errors in the error log. Some seems unrelated.
mitar commentedon Dec 11, 2017
In "Options" it looks like I am (I see my account and avatar).
shiftkey commentedon Dec 11, 2017
Ok cool, that explains why it's trying to resolve pull requests. Digging into that log file, I can see some interesting groups of issues:
If the repositories aren't being inserted correctly into the IndexedDB databases that Electron offers for apps, that would explain these errors. Does the application forget your tracked repositories when you restart it? We should have some tracing here but I'm not sure how detailed it is.
I tested this out on Fedora 16.04 and didn't spot any issues. I'm not going to focus on this for now, as the inconsistent errors here look to be environmental.
It's not clear to me whether you are running this in development mode
yarn startor production modeyarn build:prod && yarn start:prod. Also, it's not clear which distribution of Linux you are running here.mitar commentedon Dec 11, 2017
No. If I restart the app it loads the list of the repositories in the sidebar as it was before.
I have not seen in UI any issues with diffing. So I agree we leave this be for now.
I made a production webpack package and I am using that. I could try running it in some other way if it would be helpful. I am using Linux Ubuntu 17.10.
What about 404 errors?
iAmWillShepherd commentedon Dec 11, 2017
@shiftkey, I've had these issues before, but that's only while in the middle of development.
The way I got into this state was to modify one of the databases and reload the app. So one thing I'd recommend is to try deleting all the databases in the app. If after doing that and reloading the app, the issue still persists, we can rule that out as a possible cause.
@mitar , can you give this a shot? Just open Dev Tools located under the View top bar menu and go to Application -> IndexedDB -> [databases] and delete each one, then delete local storage and restart the app.
shiftkey commentedon Dec 11, 2017
As an aside:
That error looks to be with syntax highlighting, so it should be degrading to the plain diff in this case.
iAmWillShepherd commentedon Dec 11, 2017
Could you post your webpack config, please?
mitar commentedon Dec 11, 2017
Sorry. I got confused here. I had in mind appimage, not webpack. But now I realized this is not what I am really running at the moment (I tried multiple things and it didn't work for me). In fact I made a Debian package and installed that and I am using it. Same as what I described here.
So there is no special changes to the config. I just built it and installed it.
shiftkey commentedon Dec 12, 2017
@mitar can you try the workaround that @iAmWillShepherd suggested about removing the databases and then try re-adding the repository? If that works we can then look into the trickier issues.
shiftkey commentedon Dec 14, 2017
I'm going to recommend downloading the release candidate I link to in #1525 (comment) and validating the issue is reproducible there. If it is, please resubmit this (with repro steps and details) to my fork.