mholt / timeliner

All your digital life on a single timeline, stored locally -- DEPRECATED, SEE TIMELINIZE (link below)
https://timelinize.com
GNU Affero General Public License v3.0
3.57k stars 116 forks source link

Unable to add twitter data source #57

Open pfrcks opened 4 years ago

pfrcks commented 4 years ago

Currently on go 1.13.5

root@778c41ca01ec:~/timeliner/cmd/timeliner# ./timeliner add-account twitter/pfrcks                  
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7c363f]

goroutine 1 [running]:
github.com/mholt/timeliner.authorizeWithOAuth2(0xb24986, 0x7, 0x0, 0x0, 0x0, 0x80, 0xa9a0c0, 0xc000130f01, 0xc0000f6e00, 0xc000130f70)
        /root/timeliner/oauth2.go:57 +0x5f
github.com/mholt/timeliner.DataSource.authFunc.func1(0x7ffcf4a2cee9, 0x6, 0xb246df, 0x7, 0xb24986, 0x7, 0x0)
        /root/timeliner/datasource.go:116 +0x5e
github.com/mholt/timeliner.(*Timeline).Authenticate(0xc0001e77c0, 0x7ffcf4a2cee1, 0x7, 0x7ffcf4a2cee9, 0x6, 0x0, 0xc0001e77e0)
        /root/timeliner/account.go:79 +0x582
github.com/mholt/timeliner.(*Timeline).AddAccount(0xc0001e77c0, 0x7ffcf4a2cee1, 0x7, 0x7ffcf4a2cee9, 0x6, 0x1, 0x0)
        /root/timeliner/account.go:63 +0x2e5
main.main()
        /root/timeliner/cmd/timeliner/main.go:94 +0x554
root@778c41ca01ec:~/timeliner/cmd/timeliner# 
mholt commented 4 years ago

Huh, weird -- I've never encountered that. Top of stack is: https://github.com/mholt/timeliner/blob/b54071f0080f1565a33725d3e59a1035c4eebf8b/oauth2.go#L57

Do you have a chance to dig in a little more as to why? I'm afraid I won't have time to work on it for a while :(

gabriel-samfira commented 3 years ago

This seems to be caused by the fact that OAuth2AppSource() is never set by loadConfig() in main.go. In the absence of a config file, loadConfig() returns nil.

LE: This happens if you omit to specify a config file.