gphotosuploader icon indicating copy to clipboard operation
gphotosuploader copied to clipboard

Upload error: Error with ‘XXX’ :can't get an upload url

Open uioprr opened this issue 7 years ago • 10 comments

群晖docker下,执行gphotosuploader --upload / photo --maxConcurrent 4命令后,出现Upload error: Error with ‘XXX’ :can't get an upload url,请问一下是什么原因

uioprr avatar Mar 19 '19 00:03 uioprr

你需要执行的是 gphotosuploader --upload /photo --maxConcurrent 4 / 和photo之间不能有空格。

muyouming avatar Mar 19 '19 02:03 muyouming

执行的时候空格是没有,刚才编辑的时候不知道怎么搞的,囧

uioprr avatar Mar 19 '19 04:03 uioprr

022

uioprr avatar Mar 19 '19 04:03 uioprr

我用的是Moments,群晖上同步的是这个路径/homes/admin/Drive/Moments

uioprr avatar Mar 19 '19 05:03 uioprr

请把你的所有日志贴一下。

muyouming avatar Mar 20 '19 07:03 muyouming

谢谢朋友,麻烦帮我看一下。 刚才试了一下拍了一张新的照片,监控到有新的照片后上传还是失败了。

date stream content
2019-03-20 08:29:45 stdout  
2019-03-20 08:29:45 stdout 2019/03/20 08:29:45 Upload error: Error with '/photo/Mobile/MIX 2S/DCIM/2019-03-20/IMG_20190320_162903.jpg': can't get an upload url
2019-03-20 08:29:45 stdout 2019/03/20 08:29:45 Finally consuming events for the /photo/Mobile/MIX 2S/DCIM/2019-03-20/IMG_20190320_162903.jpg file
2019-03-20 08:21:19 stdout 2019/03/20 08:21:19 Finally consuming events for the /photo/Mobile/MIX 2S/DCIM/2019-03-20/@eaDir/Screenshot_2019-03-20-16-19-56-755_com.miui.home.png/SYNOPHOTO_THUMB_M.jpg file
2019-03-20 08:21:18 stdout 2019/03/20 08:21:18 Finally consuming events for the /photo/Mobile/MIX 2S/DCIM/2019-03-20/@eaDir/Screenshot_2019-03-20-16-19-56-755_com.miui.home.png/SYNOPHOTO_THUMB_SM.jpg file
2019-03-20 08:21:18 stdout 2019/03/20 08:21:18 Finally consuming events for the /photo/Mobile/MIX 2S/DCIM/2019-03-20/@eaDir/Screenshot_2019-03-20-16-19-56-755_com.miui.home.png/SYNOPHOTO_THUMB_XL.jpg file
2019-03-20 08:21:15 stdout 2019/03/20 08:21:15 Finally consuming events for the /photo/Mobile/MIX 2S/DCIM/2019-03-20 file
2019-03-20 08:15:26 stdout Press CTRL + C to stop
2019-03-20 08:15:26 stdout 2019/03/20 08:15:26 Watching 👀
2019-03-20 08:15:23 stdout 2019/03/20 08:15:23 At token taken
2019-03-20 08:15:23 stdout 2019/03/20 08:15:23 Getting a new At token ...
2019-03-20 08:15:23 stdout 2019/03/20 08:15:23 Auth file seems to be valid
2019-03-20 08:15:20 stdout 2019/03/20 08:15:20 Auth file loaded, checking validity ...
2019-03-20 08:15:16 stdout nohup: appending output to nohup.out
2019-03-20 08:15:16 stdout Run gphotosUploader
2019-03-20 08:15:16 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 08:15:16 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 08:15:16 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 08:15:16 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 08:15:16 stdout fs.inotify.max_user_watches=1048576
2019-03-20 07:12:18 stdout Press CTRL + C to stop
2019-03-20 07:12:18 stdout 2019/03/20 07:12:18 Watching 👀
2019-03-20 07:12:16 stdout 2019/03/20 07:12:16 At token taken
2019-03-20 07:12:15 stdout 2019/03/20 07:12:15 Getting a new At token ...
2019-03-20 07:12:15 stdout 2019/03/20 07:12:15 Auth file seems to be valid
2019-03-20 07:12:08 stdout 2019/03/20 07:12:08 Auth file loaded, checking validity ...
2019-03-20 07:12:04 stdout nohup: appending output to nohup.out
2019-03-20 07:12:04 stdout Run gphotosUploader
2019-03-20 07:12:04 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 07:12:04 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 07:12:04 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 07:12:04 stdout fs.inotify.max_user_watches=1048576
2019-03-20 06:57:28 stdout Press CTRL + C to stop
2019-03-20 06:57:28 stdout 2019/03/20 06:57:28 Watching 👀
2019-03-20 06:57:25 stdout 2019/03/20 06:57:25 At token taken
2019-03-20 06:57:24 stdout 2019/03/20 06:57:24 Getting a new At token ...
2019-03-20 06:57:24 stdout 2019/03/20 06:57:24 Auth file seems to be valid
2019-03-20 06:57:22 stdout 2019/03/20 06:57:22 Auth file loaded, checking validity ...
2019-03-20 06:57:18 stdout nohup: appending output to nohup.out
2019-03-20 06:57:18 stdout Run gphotosUploader
2019-03-20 06:57:18 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 06:57:18 stdout fs.inotify.max_user_watches = 1048576
2019-03-20 06:57:18 stdout fs.inotify.max_user_watches=1048576

uioprr avatar Mar 20 '19 08:03 uioprr

用upload参数的时候不能加--maxConcurrent 4,去掉就好了。

tanst avatar Mar 20 '19 12:03 tanst

但是监控文件夹后自动上传的也报这个错误。。。

uioprr avatar Mar 20 '19 13:03 uioprr

估计是你目录有中文的原因,另外,我找到了目录识别错误的问题,对比了https://github.com/simonedegiacomi/gphotosuploader的main.go文件,大概223行。

func startToWatch(filePath string, fsWatcher *fsnotify.Watcher) error {
	if watchRecursively {
		return filepath.Walk(filePath, func(path string, file os.FileInfo, err error) error {
			if file.IsDir() {
				return fsWatcher.Add(path)
			}
			return nil
		})
	} else {
		return fsWatcher.Add(filePath)
	}
}
func startToWatch(filePath string, fsWatcher *fsnotify.Watcher) error {
	if watchRecursively {
		return filepath.Walk(filePath, func(path string, file os.FileInfo, err error) error {
			if (file.IsDir()) && (!strings.Contains(file.Name(),"@eaDir")) {
				return fsWatcher.Add(path)
			}
			return nil
		})
	} else {
		return fsWatcher.Add(filePath)
	}
}

大概是作者想排除掉@eaDir目录,但是正常的目录也排除掉了,可惜我不太会,希望会的朋友能改一下逻辑。

tanst avatar Mar 28 '19 02:03 tanst

我也遇到了一样的问题 登录正常 能发现文件图片 但是上传失败了 也运行了 uploader那条命令 一样失败了

ltkun avatar Apr 29 '19 03:04 ltkun