Skip to content
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 with "print" #584

Open
yoavfreund opened this issue Jun 20, 2023 · 0 comments
Open

Error with "print" #584

yoavfreund opened this issue Jun 20, 2023 · 0 comments

Comments

@yoavfreund
Copy link

I have downloaded and linked my copy of Dropbox_Uploader. The commands info and space work fine, but I get an error with "list".

I ran in debug and looked at the dump, but I can't figure it out.

=====
bird2:~/Dropbox-Uploader$ ./dropbox_uploader.sh -d list
1.0
Linux bird2 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Debian GNU/Linux 11 \n \l

  • RESPONSE_FILE=/tmp/du_resp_debug
  • [[ '' == '' ]]
  • BIN_DEPS='sed basename date grep stat dd mkdir curl'
  • CURL_BIN=curl
  • which sed basename date grep stat dd mkdir curl
  • [[ 0 != 0 ]]
  • which readlink
  • [[ 0 == 0 ]]
    ++ readlink -m //test
  • [[ /test == /\t\e\s\t ]]
  • HAVE_READLINK=1
  • builtin printf ''
  • [[ 0 == 0 ]]
  • PRINTF='builtin printf'
  • PRINTF_OPT='-v o'
  • [[ -e /home/yoavfreund/.dropbox_uploader ]]
  • source /home/yoavfreund/.dropbox_uploader
  • [[ 2.0 != \2.\0 ]]
  • [[ 4asq9ecy72fqqpm = '' ]]
  • [[ 07y2gnebeo9d00w = '' ]]
  • [[ VadPQI_RG-AAAAAAAAAAAYcGAySR_x_7J0xI0NIc-AW-1cYU4nLQaxWSUYm8sTLh = '' ]]
  • ensure_accesstoken
    ++ date +%s
  • local now=1687281647
  • [[ '' > 1687281647 ]]
  • curl https://api.dropbox.com/oauth2/token -d grant_type=refresh_token -d refresh_token=VadPQI_RG-AAAAAAAAAAAYcGAySR_x_7J0xI0NIc-AW-1cYU4nLQaxWSUYm8sTLh -u 4asq9ecy72fqqpm:07y2gnebeo9d00w -o /tmp/du_resp_debug
  • check_http_response
  • CODE=0
  • case $CODE in
  • grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug
    ++ sed -n 's/."access_token": "([^"]).*/\1/p' /tmp/du_resp_debug
  • OAUTH_ACCESS_TOKEN=sl.BgtmHoQLujYQV0XLfUpVtw_9T-WCRu2X6Pa2dtqkVGUrmd8OgK2o4LvR8MsiN0CmzvRAs3Ux95-wGJwBvFHUyTg0l4lnK2LlAYr25Q1bEdi2Vc7q9SHmSvxsWTQFnrGQT8aVKg8
    ++ sed -n 's/."expires_in": ([0-9]).*/\1/p' /tmp/du_resp_debug
  • local expires_in=14400
  • OAUTH_ACCESS_TOKEN_EXPIRE=1687295987
  • COMMAND=list
  • ARG1=
  • ARG2=
  • let argnum=2-2
  • case $COMMAND in
  • DIR_DST=
  • [[ '' == '' ]]
  • DIR_DST=/
  • db_list //
    ++ normalize_path //
    +++ builtin printf %s /
    ++ path=/
    ++ [[ 1 == 1 ]]
    +++ readlink -m /
    ++ new_path=/
    ++ [[ / == / ]]
    ++ [[ 1 -gt 1 ]]
    ++ echo /
  • local DIR_DST=/
  • print ' > Listing "/"... '
  • [[ 0 == 0 ]]
  • echo -ne ' > Listing "/"... '

Listing "/"... + [[ / == / ]]

  • DIR_DST=
    ++ db_list_outfile ''
    ++ local DIR_DST=
    ++ local HAS_MORE=false
    ++ local CURSOR=
    ++ [[ -n '' ]]
    ++ OUT_FILE=/tmp/du_tmp_out_10978
    ++ true
    ++ [[ false == \t\r\u\e ]]
    ++ ensure_accesstoken
    +++ date +%s
    ++ local now=1687281647
    ++ [[ 1687295987 > 1687281647 ]]
    ++ return
    ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer sl.BgtmHoQLujYQV0XLfUpVtw_9T-WCRu2X6Pa2dtqkVGUrmd8OgK2o4LvR8MsiN0CmzvRAs3Ux95-wGJwBvFHUyTg0l4lnK2LlAYr25Q1bEdi2Vc7q9SHmSvxsWTQFnrGQT8aVKg8' --header 'Content-Type: application/json' --data '{"path": "","include_media_info": false,"include_deleted": false,"include_has_explicit_shared_members": false}' https://api.dropboxapi.com/2/files/list_folder
    ++ check_http_response
    ++ CODE=0
    ++ case $CODE in
    ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug
    +++ sed -n 's/."has_more": ([a-z])./\1/p' /tmp/du_resp_debug
    ++ HAS_MORE=
    +++ sed -n 's/."cursor": "([^"])"./\1/p' /tmp/du_resp_debug
    ++ CURSOR=
    ++ grep -q '^HTTP/[12].* 200' /tmp/du_resp_debug
    ++ return
  • OUT_FILE=
  • '[' -z '' ']'
  • print 'FAILED\n'
  • [[ 0 == 0 ]]
  • echo -ne 'FAILED\n'
    FAILED
  • ERROR_STATUS=1
  • return
  • remove_temp_files
  • [[ 1 == 0 ]]
  • [[ 1 -ne 0 ]]
  • echo 'Some error occured. rerun the script with "-d" option and check the output and logfile: /tmp/du_resp_debug.'
    Some error occured. rerun the script with "-d" option and check the output and logfile: /tmp/du_resp_debug.
  • exit 1

bird2:~/Dropbox-Uploader$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant