weixin_39819283
weixin_39819283
2020-12-26 17:19

Error in the web container: Request failed with status code 400

Hi, I tried to run the project (as described in the README.md: make setup && docker-compose up) – All went well but the websever:

image

The output in the docker-compose logs repeatedly shows:


web_1         |  warning  in ./node_modules/bulma/bulma.sass
web_1         | 
web_1         | (Emitted value instead of an instance of Error) postcss-custom-properties: /mnt/code/node_modules/bulma/bulma.sass:5915:5: Custom property ignored: not scoped to the top-level :root element (.columns.is-variable.is-8 { ... --columnGap: ... })
web_1         | 
web_1         |  @ ./node_modules/bulma/bulma.sass 4:14-152 13:3-17:5 14:22-160
web_1         |  @ ./.nuxt/App.js
web_1         |  @ ./.nuxt/index.js
web_1         |  @ ./.nuxt/client.js
web_1         |  @ multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/__webpack_hmr ./.nuxt/client.js

And when I hit localhost:8080 there is a different (rather longer) error message in the logs.


web_1         | { Error: Request failed with status code 400
web_1         |     at createError (/mnt/code/node_modules/axios/lib/core/createError.js:16:15)
web_1         |     at settle (/mnt/code/node_modules/axios/lib/core/settle.js:18:12)
web_1         |     at IncomingMessage.handleStreamEnd (/mnt/code/node_modules/axios/lib/adapters/http.js:201:11)
web_1         |     at IncomingMessage.emit (events.js:185:15)
web_1         |     at endReadableNT (_stream_readable.js:1106:12)
web_1         |     at process._tickCallback (internal/process/next_tick.js:178:19)
web_1         |   config: 
web_1         |    { adapter: [Function: httpAdapter],
web_1         |      transformRequest: { '0': [Function: transformRequest] },
web_1         |      transformResponse: { '0': [Function: transformResponse] },
web_1         |      timeout: 0,
web_1         |      xsrfCookieName: 'XSRF-TOKEN',
web_1         |      xsrfHeaderName: 'X-XSRF-TOKEN',
web_1         |      maxContentLength: -1,
web_1         |      validateStatus: [Function: validateStatus],
web_1         |      headers: 
web_1         |       { Accept: 'application/json, text/plain, */*',
web_1         |         'User-Agent': 'axios/0.18.0' },
web_1         |      method: 'get',
web_1         |      url: 'http://api:3000/bidding_exemptions?select=*,gazette{file_url,is_extra_edition,power}&order=date.desc',
web_1         |      data: undefined },
web_1         |   request: 
web_1         |    ClientRequest {
web_1         |      _events: 
web_1         |       { socket: [Function],
web_1         |         abort: [Function],
web_1         |         aborted: [Function],
web_1         |         error: [Function],
web_1         |         timeout: [Function],
web_1         |         prefinish: [Function: requestOnPrefinish] },
web_1         |      _eventsCount: 6,
web_1         |      _maxListeners: undefined,
web_1         |      output: [],
web_1         |      outputEncodings: [],
web_1         |      outputCallbacks: [],
web_1         |      outputSize: 0,
web_1         |      writable: true,
web_1         |      _last: true,
web_1         |      upgrading: false,
web_1         |      chunkedEncoding: false,
web_1         |      shouldKeepAlive: false,
web_1         |      useChunkedEncodingByDefault: false,
web_1         |      sendDate: false,
web_1         |      _removedConnection: false,
web_1         |      _removedContLen: false,
web_1         |      _removedTE: false,
web_1         |      _contentLength: 0,
web_1         |      _hasBody: true,
web_1         |      _trailer: '',
web_1         |      finished: true,
web_1         |      _headerSent: true,
web_1         |      socket: 
web_1         |       Socket {
web_1         |         connecting: false,
web_1         |         _hadError: false,
web_1         |         _handle: null,
web_1         |         _parent: null,
web_1         |         _host: 'api',
web_1         |         _readableState: [ReadableState],
web_1         |         readable: false,
web_1         |         _events: [Object],
web_1         |         _eventsCount: 7,
web_1         |         _maxListeners: undefined,
web_1         |         _writableState: [WritableState],
web_1         |         writable: false,
web_1         |         _bytesDispatched: 210,
web_1         |         _sockname: null,
web_1         |         _pendingData: null,
web_1         |         _pendingEncoding: '',
web_1         |         allowHalfOpen: false,
web_1         |         server: null,
web_1         |         _server: null,
web_1         |         parser: null,
web_1         |         _httpMessage: [Circular],
web_1         |         _idleNext: null,
web_1         |         _idlePrev: null,
web_1         |         _idleTimeout: -1,
web_1         |         [Symbol(asyncId)]: 27540,
web_1         |         [Symbol(lastWriteQueueSize)]: 0,
web_1         |         [Symbol(bytesRead)]: 312 },
web_1         |      connection: 
web_1         |       Socket {
web_1         |         connecting: false,
web_1         |         _hadError: false,
web_1         |         _handle: null,
web_1         |         _parent: null,
web_1         |         _host: 'api',
web_1         |         _readableState: [ReadableState],
web_1         |         readable: false,
web_1         |         _events: [Object],
web_1         |         _eventsCount: 7,
web_1         |         _maxListeners: undefined,
web_1         |         _writableState: [WritableState],
web_1         |         writable: false,
web_1         |         _bytesDispatched: 210,
web_1         |         _sockname: null,
web_1         |         _pendingData: null,
web_1         |         _pendingEncoding: '',
web_1         |         allowHalfOpen: false,
web_1         |         server: null,
web_1         |         _server: null,
web_1         |         parser: null,
web_1         |         _httpMessage: [Circular],
web_1         |         _idleNext: null,
web_1         |         _idlePrev: null,
web_1         |         _idleTimeout: -1,
web_1         |         [Symbol(asyncId)]: 27540,
web_1         |         [Symbol(lastWriteQueueSize)]: 0,
web_1         |         [Symbol(bytesRead)]: 312 },
web_1         |      _header: 'GET /bidding_exemptions?select=*,gazette%7Bfile_url,is_extra_edition,power%7D&order=date.desc HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nUser-Agent: axios/0.18.0\r\nHost: api:3000\r\nConnection: close\r\n\r\n',
web_1         |      _onPendingData: [Function: noopPendingOutput],
web_1         |      agent: 
web_1         |       Agent {
web_1         |         _events: [Object],
web_1         |         _eventsCount: 1,
web_1         |         _maxListeners: undefined,
web_1         |         defaultPort: 80,
web_1         |         protocol: 'http:',
web_1         |         options: [Object],
web_1         |         requests: {},
web_1         |         sockets: [Object],
web_1         |         freeSockets: {},
web_1         |         keepAliveMsecs: 1000,
web_1         |         keepAlive: false,
web_1         |         maxSockets: Infinity,
web_1         |         maxFreeSockets: 256 },
web_1         |      socketPath: undefined,
web_1         |      timeout: undefined,
web_1         |      method: 'GET',
web_1         |      path: '/bidding_exemptions?select=*,gazette%7Bfile_url,is_extra_edition,power%7D&order=date.desc',
web_1         |      _ended: true,
web_1         |      res: 
web_1         |       IncomingMessage {
web_1         |         _readableState: [ReadableState],
web_1         |         readable: false,
web_1         |         _events: [Object],
web_1         |         _eventsCount: 3,
web_1         |         _maxListeners: undefined,
web_1         |         socket: [Socket],
web_1         |         connection: [Socket],
web_1         |         httpVersionMajor: 1,
web_1         |         httpVersionMinor: 1,
web_1         |         httpVersion: '1.1',
web_1         |         complete: true,
web_1         |         headers: [Object],
web_1         |         rawHeaders: [Array],
web_1         |         trailers: {},
web_1         |         rawTrailers: [],
web_1         |         upgrade: false,
web_1         |         url: '',
web_1         |         method: null,
web_1         |         statusCode: 400,
web_1         |         statusMessage: 'Bad Request',
web_1         |         client: [Socket],
web_1         |         _consuming: true,
web_1         |         _dumped: false,
web_1         |         req: [Circular],
web_1         |         responseUrl: 'http://api:3000/bidding_exemptions?select=*,gazette%7Bfile_url,is_extra_edition,power%7D&order=date.desc',
web_1         |         read: [Function] },
web_1         |      aborted: undefined,
web_1         |      timeoutCb: null,
web_1         |      upgradeOrConnect: false,
web_1         |      parser: null,
web_1         |      maxHeadersCount: null,
web_1         |      _redirectable: 
web_1         |       Writable {
web_1         |         _writableState: [WritableState],
web_1         |         writable: true,
web_1         |         _events: [Object],
web_1         |         _eventsCount: 2,
web_1         |         _maxListeners: undefined,
web_1         |         _options: [Object],
web_1         |         _redirectCount: 0,
web_1         |         _requestBodyLength: 0,
web_1         |         _requestBodyBuffers: [],
web_1         |         _onNativeResponse: [Function],
web_1         |         _currentRequest: [Circular],
web_1         |         _currentUrl: 'http://api:3000/bidding_exemptions?select=*,gazette%7Bfile_url,is_extra_edition,power%7D&order=date.desc' },
web_1         |      [Symbol(isCorked)]: false,
web_1         |      [Symbol(outHeadersKey)]: { accept: [Array], 'user-agent': [Array], host: [Array] } },
web_1         |   response: 
web_1         |    { status: 400,
web_1         |      statusText: 'Bad Request',
web_1         |      headers: 
web_1         |       { 'transfer-encoding': 'chunked',
web_1         |         date: 'Wed, 25 Apr 2018 14:05:40 GMT',
web_1         |         server: 'postgrest/0.4.4.0 (f9e770b)',
web_1         |         'content-type': 'application/json; charset=utf-8' },
web_1         |      config: 
web_1         |       { adapter: [Function: httpAdapter],
web_1         |         transformRequest: [Object],
web_1         |         transformResponse: [Object],
web_1         |         timeout: 0,
web_1         |         xsrfCookieName: 'XSRF-TOKEN',
web_1         |         xsrfHeaderName: 'X-XSRF-TOKEN',
web_1         |         maxContentLength: -1,
web_1         |         validateStatus: [Function: validateStatus],
web_1         |         headers: [Object],
web_1         |         method: 'get',
web_1         |         url: 'http://api:3000/bidding_exemptions?select=*,gazette{file_url,is_extra_edition,power}&order=date.desc',
web_1         |         data: undefined },
web_1         |      request: 
web_1         |       ClientRequest {
web_1         |         _events: [Object],
web_1         |         _eventsCount: 6,
web_1         |         _maxListeners: undefined,
web_1         |         output: [],
web_1         |         outputEncodings: [],
web_1         |         outputCallbacks: [],
web_1         |         outputSize: 0,
web_1         |         writable: true,
web_1         |         _last: true,
web_1         |         upgrading: false,
web_1         |         chunkedEncoding: false,
web_1         |         shouldKeepAlive: false,
web_1         |         useChunkedEncodingByDefault: false,
web_1         |         sendDate: false,
web_1         |         _removedConnection: false,
web_1         |         _removedContLen: false,
web_1         |         _removedTE: false,
web_1         |         _contentLength: 0,
web_1         |         _hasBody: true,
web_1         |         _trailer: '',
web_1         |         finished: true,
web_1         |         _headerSent: true,
web_1         |         socket: [Socket],
web_1         |         connection: [Socket],
web_1         |         _header: 'GET /bidding_exemptions?select=*,gazette%7Bfile_url,is_extra_edition,power%7D&order=date.desc HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nUser-Agent: axios/0.18.0\r\nHost: api:3000\r\nConnection: close\r\n\r\n',
web_1         |         _onPendingData: [Function: noopPendingOutput],
web_1         |         agent: [Agent],
web_1         |         socketPath: undefined,
web_1         |         timeout: undefined,
web_1         |         method: 'GET',
web_1         |         path: '/bidding_exemptions?select=*,gazette%7Bfile_url,is_extra_edition,power%7D&order=date.desc',
web_1         |         _ended: true,
web_1         |         res: [IncomingMessage],
web_1         |         aborted: undefined,
web_1         |         timeoutCb: null,
web_1         |         upgradeOrConnect: false,
web_1         |         parser: null,
web_1         |         maxHeadersCount: null,
web_1         |         _redirectable: [Writable],
web_1         |         [Symbol(isCorked)]: false,
web_1         |         [Symbol(outHeadersKey)]: [Object] },
web_1         |      data: 
web_1         |       { message: 'Could not find foreign keys between these entities, No relation found between bidding_exemptions and gazette' } },
web_1         |   statusCode: 500,
web_1         |   name: 'NuxtServerError' }

As a newbie to Vue.js and Nuxt, may I ask if anyone have any clue about what's going on? Many thanks : )

该提问来源于开源项目:okfn-brasil/querido-diario

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39895995 weixin_39895995 4月前

    I've seen reports like this one in other Webpack-based projects.

    Can you try the following?

    1. Restart the server. Does it work?

      console
      $ docker stop $(docker ps -a -q)
      $ docker-compose up
      
    2. Rebuild the container from scratch. Does it work?

      console
      $ docker-compose build --no-cache web
      $ docker-compose up
      
    3. Rebuild the container without node modules cache. Does it work?

      console
      $ rm -r web/node_modules
      $ docker-compose build --no-cache web
      $ docker-compose up
      
    点赞 评论 复制链接分享
  • weixin_39685392 weixin_39685392 4月前
    1. Restart the server. Does it work?

    Worked :champagne:

    点赞 评论 复制链接分享
  • weixin_39819283 weixin_39819283 4月前

    ~~Neither 1, 2 nor 3 worked here :alien:~~

    ~~Gonna look for some Webpack & Docker resources one of these days : )~~

    UPDATE Took a couple of minutes and spinned up!

    点赞 评论 复制链接分享
  • weixin_39819283 weixin_39819283 4月前
    1. Rebuild the container without node modules cache. Does it work?

    Worked :champagne:

    点赞 评论 复制链接分享
  • weixin_39618956 weixin_39618956 4月前

    "UPDATE Took a couple of minutes and spinned up!" - Same here :+1:

    点赞 评论 复制链接分享

相关推荐