fazalfarhan01 / EarnApp-Docker

Containerized version of BrightData's EarnApp
https://hub.docker.com/r/fazalfarhan01/earnapp
42 stars 24 forks source link

ID is not created? #7

Closed N1CK145 closed 2 years ago

N1CK145 commented 2 years ago

Hi, i cant register my device.

root@raspberrypi: ~/docker/earnapp/etc# docker-compose up -d
                            Starting earnapp_app_1 ... done

root@raspberrypi: docker ps
CONTAINER ID   IMAGE                   COMMAND        CREATED         STATUS              PORTS     NAMES
c4662f07c8d1   fazalfarhan01/earnapp   "/sbin/init"   2 minutes ago   Up About a minute             earnapp_app_1

root@raspberrypi:~/docker/earnapp/etc# docker-compose exec app earnapp status
✔ Current status: disabled

root@raspberrypi:~/docker/earnapp/etc# docker-compose exec app earnapp register
⚠ You must register it for earnings to be added to your account.
⚠ Open the following URL in the browser:
  https://earnapp.com/r/

root@raspberrypi:~/docker/earnapp/etc# docker-compose exec app earnapp showid
(Its empty)

docker-compose.yml

version: "3.3"
services:

    app:
        image: fazalfarhan01/earnapp
        privileged: true
        volumes:
            - /sys/fs/cgroup:/sys/fs/cgroup:ro
            - ./etc:/etc/earnapp

more information

root@rapsberrypi: uname -a
Linux raspberrypi 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l GNU/Linux

Docker: 
Docker version 20.10.12, build e91ed57

Docker-Compose:
docker-compose version 1.21.0, build unknown
fazalfarhan01 commented 2 years ago

Run the install script manually. Let me know if it throws any error.

docker-compose exec app install
N1CK145 commented 2 years ago

Yes there is an error thrown by axios:

Looks like here i got the same issue as in the lite version. I get no uuid.

Shorted

https://client.earnapp.com/is_ip_blocked?uuid=&version=1.272.126&arch=arm&appid=node_earnapp.com
...
method: 'get',
    url: 'https://client.earnapp.com/is_ip_blocked',
    params: {
      uuid: '',
      version: '1.272.126',
      arch: 'arm',
      appid: 'node_earnapp.com'
    },

Full response

root@raspberrypi:~/docker/earnapp# docker-compose exec app install

███████╗░█████╗░██████╗░███╗░░██╗░█████╗░██████╗░██████╗░  ██████╗░░█████╗░░█████╗░██╗░░██╗███████╗██████╗░
██╔════╝██╔══██╗██╔══██╗████╗░██║██╔══██╗██╔══██╗██╔══██╗  ██╔══██╗██╔══██╗██╔══██╗██║░██╔╝██╔════╝██╔══██╗
█████╗░░███████║██████╔╝██╔██╗██║███████║██████╔╝██████╔╝  ██║░░██║██║░░██║██║░░╚═╝█████═╝░█████╗░░██████╔╝
██╔══╝░░██╔══██║██╔══██╗██║╚████║██╔══██║██╔═══╝░██╔═══╝░  ██║░░██║██║░░██║██║░░██╗██╔═██╗░██╔══╝░░██╔══██╗
███████╗██║░░██║██║░░██║██║░╚███║██║░░██║██║░░░░░██║░░░░░  ██████╔╝╚█████╔╝╚█████╔╝██║░╚██╗███████╗██║░░██║
╚══════╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝░░╚═╝╚═╝░░░░░╚═╝░░░░░  ╚═════╝░░╚════╝░░╚════╝░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝
An image by https://github.com/fazalfarhan01

Installing
✔ Moving /app/earnapp to /usr/bin
✔ Service earnapp enabled
✔ Service earnapp_upgrader enabled
✔ EarnApp is installed and running.
⠇ Checking IP...earnapp finish_install

Options:
  --verbose  Run with extra logs                                       [boolean]
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Error: Request failed with status code 400
    at createError (/usr/bin/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/bin/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/bin/node_modules/axios/lib/adapters/http.js:293:11)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      'User-Agent': 'axios/0.22.0'
    },
    method: 'get',
    url: 'https://client.earnapp.com/is_ip_blocked',
    params: {
      uuid: '',
      version: '1.272.126',
      arch: 'arm',
      appid: 'node_earnapp.com'
    },
    data: undefined
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      socket: [Function (anonymous)],
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: false,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: 0,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'client.earnapp.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'client.earnapp.com',
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 64,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object],
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'GET /is_ip_blocked?uuid=&version=1.272.126&arch=arm&appid=node_earnapp.com HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'User-Agent: axios/0.22.0\r\n' +
      'Host: client.earnapp.com\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: noopPendingOutput],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object],
      requests: {},
      sockets: [Object],
      freeSockets: {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'fifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'GET',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/is_ip_blocked?uuid=&version=1.272.126&arch=arm&appid=node_earnapp.com',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      headers: [Object],
      rawHeaders: [Array],
      trailers: {},
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 400,
      statusMessage: 'Bad Request',
      client: [TLSSocket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'https://client.earnapp.com/is_ip_blocked?uuid=&version=1.272.126&arch=arm&appid=node_earnapp.com',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'client.earnapp.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 0,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'https://client.earnapp.com/is_ip_blocked?uuid=&version=1.272.126&arch=arm&appid=node_earnapp.com',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'user-agent': [Array],
      host: [Array]
    }
  },
  response: {
    status: 400,
    statusText: 'Bad Request',
    headers: {
      server: 'nginx',
      date: 'Tue, 28 Dec 2021 15:27:40 GMT',
      'content-type': 'text/html; charset=utf-8',
      'content-length': '17',
      connection: 'close',
      'cache-control': 'private,no-store'
    },
    config: {
      transitional: [Object],
      adapter: [Function: httpAdapter],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      validateStatus: [Function: validateStatus],
      headers: [Object],
      method: 'get',
      url: 'https://client.earnapp.com/is_ip_blocked',
      params: [Object],
      data: undefined
    },
    request: <ref *1> ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      socket: [TLSSocket],
      _header: 'GET /is_ip_blocked?uuid=&version=1.272.126&arch=arm&appid=node_earnapp.com HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'User-Agent: axios/0.22.0\r\n' +
        'Host: client.earnapp.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: noopPendingOutput],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/is_ip_blocked?uuid=&version=1.272.126&arch=arm&appid=node_earnapp.com',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'client.earnapp.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    data: 'Invalid arguments'
  },
  isAxiosError: true,
  toJSON: [Function: toJSON]
}
fazalfarhan01 commented 2 years ago

It's a known error with no solution.. I have no idea as to why this happens.. Usually running the install command (docker-compose exec app install) twice or thrice fixed it.. But sometimes it doesn't no matter what.. but giving it a day to update to a newer version fixes it..

fazalfarhan01 commented 2 years ago

try running the install command on the lite version as well and let me know if it throws any similar error..

sign0 commented 2 years ago

try running the install command on the lite version as well and let me know if it throws any similar error..

Same error for me on my implementation from scratch and with your both images. The installation workflow work well natively on the latest raspberry PI OS...

fazalfarhan01 commented 2 years ago

try running the install command on the lite version as well and let me know if it throws any similar error..

Same error for me on my implementation from scratch and with your both images. The installation workflow work well natively on the latest raspberry PI OS...

Have you tried the debian image as the base image?

sign0 commented 2 years ago

try running the install command on the lite version as well and let me know if it throws any similar error..

Same error for me on my implementation from scratch and with your both images. The installation workflow work well natively on the latest raspberry PI OS...

Have you tried the debian image as the base image?

Yes, same problem on debian (bullseye) and ubuntu (20.04 and 21.04)

sign0 commented 2 years ago

Any idea what should be in the body of the post request instead of the data: undefined ?

fazalfarhan01 commented 2 years ago

Well the error is only on arm32 CPUs.. I have tried it on arm64 CPUs and it works fine. The data payload is most probably some telemetry information about the device itself and may be because docker for arm32 is built slightly differently (guessing), earnapp isn't able to pick up the telemetry information it needs which causes the error.

Can't tell anything unless one has the source code..

sign0 commented 2 years ago

Well the error is only on arm32 CPUs.. I have tried it on arm64 CPUs and it works fine. The data payload is most probably some telemetry information about the device itself and may be because docker for arm32 is built slightly differently (guessing), earnapp isn't able to pick up the telemetry information it needs which causes the error.

Can't tell anything unless one has the source code..

It's strange because I am debugging from a raspberry pi 4B on which earnapp installed natively works well (since 2 days) and where the containerized version does not work

fazalfarhan01 commented 2 years ago

You can use tcpdump to analyse the TCP traffic to find what the data payload actually is. A solution for it can then be found.

sign0 commented 2 years ago

Ok, I will try this later (i will try a native install with --verbose option before tcpdump), I will post here if I find a way to fix the problem... Thanks for your help !

fazalfarhan01 commented 2 years ago

Containerised version of EarnApp doesn't seem to work on a Raspberry Pi with the default operating system installed.

It would be great if any one having ubuntu 64 bit installed with docker on Pi could test it out.

lepipo commented 2 years ago

Hi, you need this apt install systemctl

after that it's ok