meganz / MEGAcmd

Command Line Interactive and Scriptable Application to access MEGA
Other
1.95k stars 406 forks source link

error: cannot convert ‘std::string*’ {aka ‘std::__cxx11::basic_string<char>*’} to ‘mega::LocalPath&’ #438

Open roblav96 opened 4 years ago

roblav96 commented 4 years ago

Trying to build this with the latest sdk repo, I keep getting this error:

make

  CXX      src/mega_cmd_server-configurationmanager.o
src/configurationmanager.cpp: In static member function ‘static void megacmd::ConfigurationManager::loadConfigDir()’:
src/configurationmanager.cpp:136:71: error: cannot convert ‘std::string*’ {aka ‘std::__cxx11::basic_string<char>*’} to ‘mega::LocalPath&’
  136 |     if (!is_file_exist(configFolder.c_str()) && !fsAccess->mkdirlocal(&localConfigFolder, true))
      |                                                                       ^~~~~~~~~~~~~~~~~~
      |                                                                       |
      |                                                                       std::string* {aka std::__cxx11::basic_string<char>*}
In file included from ./sdk/include/mega.h:77,
                 from ./sdk/include/megaapi_impl.h:28,
                 from src/megacmd.h:41,
                 from src/configurationmanager.h:22,
                 from src/configurationmanager.cpp:19:
./sdk/include/mega/posix/megafs.h:106:21: note:   initializing argument 1 of ‘virtual bool mega::PosixFileSystemAccess::mkdirlocal(mega::LocalPath&, bool)’
  106 |     bool mkdirlocal(LocalPath&, bool) override;
      |                     ^~~~~~~~~~
make[2]: *** [Makefile:1173: src/mega_cmd_server-configurationmanager.o] Error 1

./configure

configure: Configured to build Mega SDK:

  SDK version:      3.7.3
  Host setup:       x86_64-pc-linux-gnu
  Install prefix:   /home/ubuntu/.playground/MEGAcmd/usr/local
  Compiler:         g++
  CXXFLAGS:         -g -O2 -DNDEBUG=1 -fPIC
  LDFLAGS:          -lstdc++fs -lrt -pthread
  gcc hardening:    no
  debug:            no
  static:           no
  sync subsystem:   yes
  chat:             no
  MEGA API          yes
  example apps:     yes

  inotify:          yes
  posix threads:    yes

  Python bindings:  no
  Python3 bindings: no
  PHP bindings:     no
  SWIG_FLAGS_PHP:

  Java bindings:    no

  OpenSSL:            -lssl -lcrypto
  Crypto++:           -lcryptopp
  Sodium:             -lsodium
  Zlib:               -lz
  SQLite3:            -lsqlite3
  c-ares:             -lcares
  cURL:              -lcurl
  FreeImage:          -lfreeimage
  Readline:           -lreadline
  Termcap:            -ltermcap
  PCRE:
  LIBUV:              -luv
  LIBRAW:              -lraw -fopenmp
  LIBMEDIAINFO:       -DUNICODE -lmediainfo -lzen -pthread
  FFMPEG:             -lavcodec -lavformat -lavutil -lswscale

configure: MEGAcmd configuration:

  MEGACMD version:      1.3.0
  Install prefix:   /home/ubuntu/.playground/MEGAcmd/usr/local
  Compiler:         g++
  CXXFLAGS:         -g -O2 -DNDEBUG=1 -fPIC -DENABLE_BACKUPS=1
  CPPFLAGS:
  LDFLAGS:          -pthread
  debug:            no
  static:           no
  posix threads:    yes

  Readline:           -lreadline
  Termcap:            -ltermcap
  PCRE:               -lpcrecpp -lpcre
  SDK includes:     -I. -I./include -I./include/mega -I./include/mega/posix -I./third_party/utf8proc
dwmega commented 4 years ago

Hey @roblav96,

MEGACmd has not yet been updated to build against the latest and greatest in the SDK.

Please try building MEGACmd against the SDK revision specified by the SDK submodule.

You can determine which revision you need by issuing the git submodule command within the MEGACmd source tree.

roblav96 commented 4 years ago

Preface: DevOps Engineer 🤓

@dwmega Thanks for getting back to me. I have no problem making and installing the git submodule commit hash after git clone, the problem I'm facing is an unusable mega-cmd-server on Ubuntu 20.04 (both the megacmd_1.3.0-4.1_amd64.deb and this repo's latest commit)

lsb_release -a && uname -a

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal
Linux ubuntu 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

No matter what I've tried, I can't figure out these curl errors: Disabling cURL timeout followed by Set cURL timeout[1] to 931277 ms from 298 for every attempted connection. This makes webdav unusable and file uploads end up corrupted.

tail -f -n 100 ~/.megaCmd/megacmdserver.log

[API:debug: 18:09:28] Transfer request finished (1) Position: 511180800 (511180800) Size: 1048576 Completed: 509083648 of 1318948718
[API:debug: 18:09:28] Contiguous progress: 509083648 (2097152)
[API:debug: 18:09:28] Caching transfer
[API:debug: 18:09:28] DB transaction BEGIN ~/.megaCmd/megaclient_statecache12_transfers_123456789.db
[API:debug: 18:09:28] Opening async file handle for reading
[API:debug: 18:09:28] DB transaction COMMIT ~/.megaCmd/megaclient_statecache12_transfers_123456789.db
[API:debug: 18:09:28] Encrypted chunk: 511180800 - 512229376   Size: 1048576
[API:debug: 18:09:28] Closing async file handle
[API:debug: 18:09:28] DNS cache hit for gfs123456789.userstorage.mega.co.nz (IPv4) 123.456.789.101
[API:debug: 18:09:28] POST target URL: http://gfs123456789.userstorage.mega.co.nz/ul/12345-67890/511180800?c=Wa6aT-hBL0RM0n6M
[API:debug: 18:09:28] [sending 1048576 bytes of raw data]
[API:debug: 18:09:28] Using the IP of the hostname: 123.456.789.101
[API:debug: 18:09:28] Set cURL timeout[1] to 931252 ms from 0
[API:debug: 18:09:28] Disabling cURL timeout
[API:debug: 18:09:28] Adding/setting curl socket 103 to 3
[API:debug: 18:09:28] Set cURL timeout[1] to 931260 ms from 725
[API:debug: 18:09:28] Adding/setting curl socket 103 to 1
[API:debug: 18:09:28] Removing socket 102
[API:debug: 18:09:28] Set cURL timeout[1] to 931262 ms from 378
[API:debug: 18:09:28] CURLMSG_DONE with HTTP status: 200 from gfs123456789.userstorage.mega.co.nz - 123.456.789.101
[API:debug: 18:09:28] [received 0 bytes of raw data]
[API:debug: 18:09:28] Transfer request finished (1) Position: 512229376 (512229376) Size: 1048576 Completed: 510132224 of 1318948718
[API:debug: 18:09:28] Contiguous progress: 510132224 (2097152)
[API:debug: 18:09:28] Caching transfer
[API:debug: 18:09:28] DB transaction BEGIN ~/.megaCmd/megaclient_statecache12_transfers_123456789.db
[API:debug: 18:09:28] Opening async file handle for reading
[API:debug: 18:09:28] DB transaction COMMIT ~/.megaCmd/megaclient_statecache12_transfers_123456789.db
[API:debug: 18:09:28] Encrypted chunk: 512229376 - 513277952   Size: 1048576
[API:debug: 18:09:28] Closing async file handle
[API:debug: 18:09:28] DNS cache hit for gfs123456789.userstorage.mega.co.nz (IPv4) 123.456.789.101
[API:debug: 18:09:28] POST target URL: http://gfs123456789.userstorage.mega.co.nz/ul/12345-67890/512229376?c=YjoW6fwMsD0jI6S4
[API:debug: 18:09:28] [sending 1048576 bytes of raw data]
[API:debug: 18:09:28] Using the IP of the hostname: 123.456.789.101
[API:debug: 18:09:28] Set cURL timeout[1] to 931258 ms from 0
[API:debug: 18:09:28] Disabling cURL timeout
[API:debug: 18:09:28] Adding/setting curl socket 102 to 3
[API:debug: 18:09:28] Set cURL timeout[1] to 931262 ms from 368
[API:debug: 18:09:28] Adding/setting curl socket 102 to 1
[API:debug: 18:09:29] Disabling cURL timeout
[API:debug: 18:09:29] Set cURL timeout[1] to 931263 ms from 13
[API:debug: 18:09:29] Disabling cURL timeout
[API:debug: 18:09:29] Set cURL timeout[1] to 931268 ms from 499
[API:debug: 18:09:29] Removing socket 104
[API:debug: 18:09:29] CURLMSG_DONE with HTTP status: 200 from gfs123456789.userstorage.mega.co.nz - 123.456.789.101
[API:debug: 18:09:29] [received 0 bytes of raw data]
[API:debug: 18:09:29] Transfer request finished (1) Position: 513277952 (513277952) Size: 1048576 Completed: 511180800 of 1318948718
[API:debug: 18:09:29] Contiguous progress: 511180800 (2097152)
[API:debug: 18:09:29] Caching transfer
[API:debug: 18:09:29] DB transaction BEGIN ~/.megaCmd/megaclient_statecache12_transfers_123456789.db
[API:debug: 18:09:29] Opening async file handle for reading
[API:debug: 18:09:29] DB transaction COMMIT ~/.megaCmd/megaclient_statecache12_transfers_123456789.db
[API:debug: 18:09:29] Encrypted chunk: 513277952 - 514326528   Size: 1048576
[API:debug: 18:09:29] Closing async file handle
[API:debug: 18:09:29] DNS cache hit for gfs123456789.userstorage.mega.co.nz (IPv4) 123.456.789.101
[API:debug: 18:09:29] POST target URL: http://gfs123456789.userstorage.mega.co.nz/ul/12345-67890/513277952?c=Kpg_Ybc6gXoEM8fm
[API:debug: 18:09:29] [sending 1048576 bytes of raw data]
[API:debug: 18:09:29] Using the IP of the hostname: 123.456.789.101
[API:debug: 18:09:29] Set cURL timeout[1] to 931263 ms from 0
[API:debug: 18:09:29] Disabling cURL timeout
[API:debug: 18:09:29] Adding/setting curl socket 104 to 3
[API:debug: 18:09:29] Set cURL timeout[1] to 931268 ms from 462
[API:debug: 18:09:29] Adding/setting curl socket 104 to 1
[API:debug: 18:09:29] Removing socket 103
[API:debug: 18:09:29] CURLMSG_DONE with HTTP status: 200 from gfs123456789.userstorage.mega.co.nz - 123.456.789.101
[API:debug: 18:09:29] [received 0 bytes of raw data]
[API:debug: 18:09:29] Transfer request finished (1) Position: 514326528 (514326528) Size: 1048576 Completed: 512229376 of 1318948718
[API:debug: 18:09:29] Contiguous progress: 512229376 (2097152)
[API:debug: 18:09:29] Caching transfer
[API:debug: 18:09:29] DB transaction BEGIN ~/.megaCmd/megaclient_statecache12_transfers_123456789.db
[API:debug: 18:09:29] Opening async file handle for reading
[API:debug: 18:09:29] DB transaction COMMIT ~/.megaCmd/megaclient_statecache12_transfers_123456789.db
[API:debug: 18:09:29] Encrypted chunk: 514326528 - 515375104   Size: 1048576
[API:debug: 18:09:29] Closing async file handle
[API:debug: 18:09:29] DNS cache hit for gfs123456789.userstorage.mega.co.nz (IPv4) 123.456.789.101
[API:debug: 18:09:29] POST target URL: http://gfs123456789.userstorage.mega.co.nz/ul/12345-67890/514326528?c=rF-kGTj1lGvN8NUm
[API:debug: 18:09:29] [sending 1048576 bytes of raw data]
[API:debug: 18:09:29] Using the IP of the hostname: 123.456.789.101
[API:debug: 18:09:29] Set cURL timeout[1] to 931267 ms from 0
[API:debug: 18:09:29] Disabling cURL timeout
[API:debug: 18:09:29] Adding/setting curl socket 103 to 3
[API:debug: 18:09:29] Set cURL timeout[1] to 931268 ms from 70
[API:debug: 18:09:29] Adding/setting curl socket 103 to 1
[API:debug: 18:09:29] Disabling cURL timeout
[API:debug: 18:09:29] Set cURL timeout[1] to 931274 ms from 508
[API:debug: 18:09:30] Disabling cURL timeout
[API:debug: 18:09:30] Set cURL timeout[1] to 931277 ms from 298
[API:debug: 18:09:30] Disabling cURL timeout
[API:debug: 18:09:30] Set cURL timeout[1] to 931278 ms from 98
[API:debug: 18:09:30] Disabling cURL timeout
[API:debug: 18:09:30] Set cURL timeout[1] to 931284 ms from 600
[API:debug: 18:09:31] Disabling cURL timeout
[API:debug: 18:09:31] Set cURL timeout[1] to 931287 ms from 298
[API:debug: 18:09:31] Disabling cURL timeout
[API:debug: 18:09:31] Set cURL timeout[1] to 931288 ms from 98
[API:debug: 18:09:31] Disabling cURL timeout
[API:debug: 18:09:31] Set cURL timeout[1] to 931294 ms from 600
[API:debug: 18:09:32] Disabling cURL timeout
[API:debug: 18:09:32] Set cURL timeout[1] to 931297 ms from 298
[API:debug: 18:09:32] Disabling cURL timeout
[API:debug: 18:09:32] Set cURL timeout[1] to 931298 ms from 98
[API:debug: 18:09:32] Disabling cURL timeout
[API:debug: 18:09:32] Set cURL timeout[1] to 931304 ms from 600
[API:debug: 18:09:33] Disabling cURL timeout
[API:debug: 18:09:33] Set cURL timeout[1] to 931307 ms from 298
[API:debug: 18:09:33] Disabling cURL timeout
[API:debug: 18:09:33] Set cURL timeout[1] to 931308 ms from 98
[API:debug: 18:09:33] Disabling cURL timeout
[API:debug: 18:09:33] Set cURL timeout[1] to 931314 ms from 600

I was hoping to build and install the bleeding edge SDK updates, maybe these problems have already been resolve 😇

Cheers mate 🍻