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

500 'Fatal error' When Creating Dashboard Through Public API #22704

Closed
cmiller96 opened this issue Jan 12, 2023 · 6 comments
Closed

500 'Fatal error' When Creating Dashboard Through Public API #22704

cmiller96 opened this issue Jan 12, 2023 · 6 comments
Labels
#bug Bug report

Comments

@cmiller96
Copy link

cmiller96 commented Jan 12, 2023

When trying to create a dashboard through the public API I get a response with a 500 status and the body is

{
    "message": "Fatal error"
}

The logs show

2023-01-12 06:10:50,034:ERROR:root:'AnonymousUserMixin' object has no attribute '_sa_instance_state'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 86, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/views/base_api.py", line 113, in wraps
    raise ex
  File "/app/superset/views/base_api.py", line 110, in wraps
    duration, response = time_function(f, self, *args, **kwargs)
  File "/app/superset/utils/core.py", line 1524, in time_function
    response = func(*args, **kwargs)
  File "/app/superset/utils/log.py", line 245, in wrapper
    value = f(*args, **kwargs)
  File "/app/superset/views/base_api.py", line 83, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/dashboards/api.py", line 507, in post
    new_model = CreateDashboardCommand(g.user, item).run()
  File "/app/superset/dashboards/commands/create.py", line 45, in run
    dashboard = DashboardDAO.create(self._properties, commit=False)
  File "/app/superset/dao/base.py", line 126, in create
    db.session.add(model)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/scoping.py", line 163, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2023, in add
    self._save_or_update_state(state)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2039, in _save_or_update_state
    for o, m, st_, dct_ in mapper.cascade_iterator(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/mapper.py", line 3098, in cascade_iterator
    queue = deque(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/relationships.py", line 1938, in cascade_iterator
    tuples = state.manager[self.key].impl.get_all_pending(state, dict_)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 1153, in get_all_pending
    current_states = [
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 1154, in <listcomp>
    ((c is not None) and instance_state(c) or None, c)
AttributeError: 'AnonymousUserMixin' object has no attribute '_sa_instance_state'

How to reproduce the bug

docker-compose.yml

version: '3'
services:
  redis:
    image: redis
    restart: always
    volumes:
      - redis:/data

  superset:
    image: apache/superset:2.0.1
    restart: always
    depends_on:
      - redis
    ports:
      - "8088"
    volumes:
      - ${PWD}/superset_config.py:/app/pythonpath/superset_config.py

volumes:
  redis:

superset_config.py

ENABLE_PROXY_FIX = True

FEATURE_FLAGS = {
    "EMBEDDED_SUPERSET": True
}

SQLALCHEMY_DATABASE_URI = # My external postgres database uri. I get the same error using the internal db though.
SECRET_KEY = # My secret key

SESSION_COOKIE_SAMESITE = None
ENABLE_PROXY_FIX = True
PUBLIC_ROLE_LIKE = "Gamma"

CORS_OPTIONS = {
  'supports_credentials': True,
  'allow_headers': ['*'],
  'resources':['*'],
  'origins': ['*']
}

WTF_CSRF_ENABLED = False

test.js

const axios = require('axios')
const SUPERSET_HOST = 'http://localhost:8088'

async function createDashboard() {
    try {
        const result = await axios({
            url: `${SUPERSET_HOST}/api/v1/dashboard/`,
            data: {
                dashboard_title: 'Some Title'
            },
            headers: {
                Authorization: 'Bearer ' + await getAuthToken()
            },
            method: 'post'
        });

        console.log(result);
    } catch (err) {
        console.log(err.response.status); // 500
        console.log(err.response.data); // { message: 'Fatal error' }
    }
}

async function getAuthToken() {
    const result = await axios({
        url: `${SUPERSET_HOST}/api/v1/security/login`,
        data: {
            "username": 'admin',
            "password": 'admin',
            "provider": "db",
            "refresh": true
        },
        method: 'post'
    });

    return result?.data?.access_token;
}

createDashboard()

Expected results

Expect dashboard to get created.

Actual results

Get status code 500. 'Fatal error'

Environment

  • superset version: 2.0.1
  • node.js version: v14.20.0
  • any feature flags active: Embedded Dashboards

Checklist

  • [ X] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ X] I have reproduced the issue with at least the latest released version of superset.
  • [ X] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

The following code produces a 401. Could the user not be getting set from the token? I'm not performing these requests anonymously, so I don't know why I am getting the error 'AnonymousUserMixin' object has no attribute '_sa_instance_state'.
Also it works when I use the swagger ui, but that request sends a cookie not a bearer token.

async function whoAmI() {
    try {
        const result = await axios( {
            url: `${SUPERSET_HOST}/api/v1/me/`,
            headers: {
                Authorization: 'Bearer ' + await getAuthToken()
            },
            method: 'get'
        } );

        console.log(result);
    } catch (err) {
        console.log(err.response.status); // 401
        console.log(err.response.data); // { message: 'Not authorized' }
    }
}
@cmiller96 cmiller96 added the #bug Bug report label Jan 12, 2023
@ShaliniIruvuru
Copy link

ShaliniIruvuru commented Apr 20, 2023

Working as Expected.Created a dashboard

Screenshots:-
image
image

test.js:-
const axios = require('axios')
const SUPERSET_HOST = 'http://localhost:9000'

async function createDashboard() {
try {
const result = await axios({
url: ${SUPERSET_HOST}/api/v1/dashboard/,
data: {
dashboard_title: 'New Dashboard1'
},
headers: {
Authorization: 'Bearer ' + await getAuthToken()
},
method: 'post'
});

    console.log(result);
} catch (err) {
    console.log(err.response.status); 
    console.log(err.response.data); 
}

}

async function getAuthToken() {
const result = await axios({
url: ${SUPERSET_HOST}/api/v1/security/login,
data: {
"username": 'admin',
"password": 'admin',
"provider": "db",
"refresh": true
},
method: 'post'
});

return result?.data?.access_token;

}
createDashboard()

Output:-

[Running] node "/home/shali/AS_202/test.js"
{
status: 201,
statusText: 'CREATED',
headers: AxiosHeaders {
'x-powered-by': 'Express',
server: 'Werkzeug/2.1.2 Python/3.8.10',
date: 'Thu, 20 Apr 2023 07:53:05 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '75',
vary: 'Accept-Encoding',
connection: 'close'
},
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [ 'xhr', 'http' ],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: { FormData: [Function], Blob: null },
validateStatus: [Function: validateStatus],
headers: AxiosHeaders {
Accept: 'application/json, text/plain, /',
'Content-Type': 'application/json',
Authorization: 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjgxOTc3MTg1LCJqdGkiOiI2N2QyOWY4ZC04YTI2LTQ1ZWMtYjUzZS1jZjI4Y2JiOGJkYTkiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoxLCJuYmYiOjE2ODE5NzcxODUsImV4cCI6MTY4MTk3ODA4NX0.G-gW5rdzNmpGUp3FW29WPRV-42gN8z2G9OvCvni2DmQ',
'User-Agent': 'axios/1.3.6',
'Content-Length': '36',
'Accept-Encoding': 'gzip, compress, deflate, br'
},
url: 'http://localhost:9000/api/v1/dashboard/',
data: '{"dashboard_title":"New Dashboard1"}',
method: 'post'
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype] {
abort: [Function (anonymous)],
aborted: [Function (anonymous)],
connect: [Function (anonymous)],
error: [Function (anonymous)],
socket: [Function (anonymous)],
timeout: [Function (anonymous)],
finish: [Function: requestOnFinish]
},
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: '36',
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
socket: Socket {
connecting: false,
_hadError: false,
_parent: null,
_host: 'localhost',
_closeAfterHandlingError: false,
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 7,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
parser: null,
_httpMessage: [Circular *1],
[Symbol(async_id_symbol)]: 29,
[Symbol(kHandle)]: [TCP],
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kSetNoDelay)]: false,
[Symbol(kSetKeepAlive)]: true,
[Symbol(kSetKeepAliveInitialDelay)]: 60,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(RequestTimeout)]: undefined
},
_header: 'POST /api/v1/dashboard/ HTTP/1.1\r\n' +
'Accept: application/json, text/plain, /\r\n' +
'Content-Type: application/json\r\n' +
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjgxOTc3MTg1LCJqdGkiOiI2N2QyOWY4ZC04YTI2LTQ1ZWMtYjUzZS1jZjI4Y2JiOGJkYTkiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoxLCJuYmYiOjE2ODE5NzcxODUsImV4cCI6MTY4MTk3ODA4NX0.G-gW5rdzNmpGUp3FW29WPRV-42gN8z2G9OvCvni2DmQ\r\n' +
'User-Agent: axios/1.3.6\r\n' +
'Content-Length: 36\r\n' +
'Accept-Encoding: gzip, compress, deflate, br\r\n' +
'Host: localhost:9000\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 80,
protocol: 'http:',
options: [Object: null prototype],
requests: [Object: null prototype] {},
sockets: [Object: null prototype],
freeSockets: [Object: null prototype] {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 1,
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/api/v1/dashboard/',
_ended: true,
res: IncomingMessage {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 4,
_maxListeners: undefined,
socket: [Socket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
rawHeaders: [Array],
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 201,
statusMessage: 'CREATED',
client: [Socket],
_consuming: true,
_dumped: false,
req: [Circular *1],
responseUrl: 'http://localhost:9000/api/v1/dashboard/',
redirects: [],
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 14,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0,
[Symbol(RequestTimeout)]: undefined
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'localhost',
protocol: 'http:',
_redirectable: Writable {
_writableState: [WritableState],
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
_options: [Object],
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 36,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: [Circular *1],
_currentUrl: 'http://localhost:9000/api/v1/dashboard/',
[Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kEndCalled)]: true,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
'content-type': [Array],
authorization: [Array],
'user-agent': [Array],
'content-length': [Array],
'accept-encoding': [Array],
host: [Array]
},
[Symbol(kUniqueHeaders)]: null
},
data: { id: 36, result: { dashboard_title: 'New Dashboard1' } }
}

[Done] exited with code=0 in 0.306 seconds

@lekhanhtoan37
Copy link

Same issue
192.168.96.1 - - [29/Jul/2023:14:24:32 +0000] "POST /superset/log/?explode=events&dashboard_id=1 HTTP/1.1" 200 20 "http://0.0.0.0:8088/dashboard/list/?pageIndex=0&sortColumn=changed_on_delta_humanized&sortOrder=desc&viewMode=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
'AnonymousUserMixin' object has no attribute 'sa_instance_state'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/security/decorators.py", line 137, in wraps
return f(self, *args, **kwargs)
File "/app/superset/views/dashboard/views.py", line 123, in new
db.session.add(new_dashboard)
File "", line 2, in add
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2610, in add
self.save_or_update_state(state)
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2626, in save_or_update_state
for o, m, st
, dct
in mapper.cascade_iterator(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/mapper.py", line 3202, in cascade_iterator
queue = deque(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/relationships.py", line 1986, in cascade_iterator
tuples = state.manager[self.key].impl.get_all_pending(state, dict
)
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/attributes.py", line 1399, in get_all_pending
current_states = [
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/attributes.py", line 1400, in
((c is not None) and instance_state(c) or None, c)
AttributeError: 'AnonymousUserMixin' object has no attribute '_sa_instance_state'

@justmike1
Copy link
Contributor

justmike1 commented Aug 27, 2023

same issue here, same log output as @lekhanhtoan37

EDIT: added test code:

package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

const (
	supersetURL    = "https://subdomain.domain.net"
	datasourceName = "someDatasource"
	databaseURL    = "postgresql://some-username:some-password@some-host:5432/backend"
	loginURL       = supersetURL + "/api/v1/security/login"
)

type LoginRequest struct {
	Password string `json:"password"`
	Provider string `json:"provider"`
	Refresh  bool   `json:"refresh"`
	Username string `json:"username"`
}

type LoginResponse struct {
	AccessToken string `json:"access_token"`
}

type DatabasePayload struct {
	Engine              string `json:"engine"`
	ConfigurationMethod string `json:"configuration_method"`
	DatabaseName        string `json:"database_name"`
	SQLAlchemyURI       string `json:"sqlalchemy_uri"`
}

type DashboardPayload struct {
	DashboardName string `json:"dashboard_title"`
}

func getAccessToken() (string, error) {
	// Prepare payload for authentication
	loginPayload := LoginRequest{
		Password: "somepassword",
		Provider: "db",
		Refresh:  true,
		Username: "do-not-change",
	}

	payloadBytes, err := json.Marshal(loginPayload)
	if err != nil {
		return "", err
	}

	resp, err := http.Post(loginURL, "application/json", bytes.NewBuffer(payloadBytes))
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	var loginResp LoginResponse
	if err := json.NewDecoder(resp.Body).Decode(&loginResp); err != nil {
		return "", err
	}

	return loginResp.AccessToken, nil
}

func createDashboard(client *http.Client, token string) {
	// Endpoint URL
	dashboardURL := supersetURL + "/api/v1/dashboard/"

	// Prepare dashboard payload
	dashboardPayload := DashboardPayload{
		DashboardName: "ashboard",
	}

	payloadBytes, err := json.Marshal(dashboardPayload)
	if err != nil {
		fmt.Println("Error marshalling dashboard payload:", err)
		return
	}

	// Create request for the dashboard
	req, err := http.NewRequest("POST", dashboardURL, bytes.NewBuffer(payloadBytes))
	if err != nil {
		fmt.Println("Error creating dashboard request:", err)
		return
	}

	// Set headers
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Content-Type", "application/json")

	// Send request
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error sending dashboard request:", err)
		return
	}
	defer resp.Body.Close()

	// Read and print response
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("Error reading dashboard response body:", err)
		return
	}

	fmt.Println("Dashboard Response:", string(body))
}

func main() {
	client := &http.Client{}

	// Get the access token first
	token, err := getAccessToken()
	if err != nil {
		fmt.Println("Error getting access token:", err)
		return
	}

	// Prepare payload for database connection
	payload := DatabasePayload{
		ConfigurationMethod: "sqlalchemy_form",
		Engine:              "postgresql",
		DatabaseName:        datasourceName,
		SQLAlchemyURI:       databaseURL,
	}

	payloadBytes, err := json.Marshal(payload)
	if err != nil {
		fmt.Println("Error marshalling payload:", err)
		return
	}

	// Create request
	req, err := http.NewRequest("POST", supersetURL+"/api/v1/database/", bytes.NewBuffer(payloadBytes))
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}

	// Set headers
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Content-Type", "application/json")

	// Send request
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error sending request:", err)
		return
	}
	defer resp.Body.Close()

	// Read and print response
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("Error reading response body:", err)
		return
	}

	fmt.Println("Response:", string(body))
	createDashboard(client, token)
}

The datasource creation does work, the dashboard creation gives fatal error and: AttributeError: 'AnonymousUserMixin' object has no attribute '_sa_instance_state'

@justmike1
Copy link
Contributor

it works only when using the swagger UI and being logged in, I believe the the token using in /secure/login does not work in the /dashboard/ endpoint

@cmiller96
Copy link
Author

I was able to get the api working by upgrading to v3.0.1

@mdevale
Copy link

mdevale commented May 20, 2024

Working as Expected.Created a dashboard

Screenshots:- image image

test.js:- const axios = require('axios') const SUPERSET_HOST = 'http://localhost:9000'

async function createDashboard() { try { const result = await axios({ url: ${SUPERSET_HOST}/api/v1/dashboard/, data: { dashboard_title: 'New Dashboard1' }, headers: { Authorization: 'Bearer ' + await getAuthToken() }, method: 'post' });

    console.log(result);
} catch (err) {
    console.log(err.response.status); 
    console.log(err.response.data); 
}

}

async function getAuthToken() { const result = await axios({ url: ${SUPERSET_HOST}/api/v1/security/login, data: { "username": 'admin', "password": 'admin', "provider": "db", "refresh": true }, method: 'post' });

return result?.data?.access_token;

} createDashboard()

Output:-

[Running] node "/home/shali/AS_202/test.js" { status: 201, statusText: 'CREATED', headers: AxiosHeaders { 'x-powered-by': 'Express', server: 'Werkzeug/2.1.2 Python/3.8.10', date: 'Thu, 20 Apr 2023 07:53:05 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '75', vary: 'Accept-Encoding', connection: 'close' }, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: null }, validateStatus: [Function: validateStatus], headers: AxiosHeaders { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', Authorization: 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjgxOTc3MTg1LCJqdGkiOiI2N2QyOWY4ZC04YTI2LTQ1ZWMtYjUzZS1jZjI4Y2JiOGJkYTkiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoxLCJuYmYiOjE2ODE5NzcxODUsImV4cCI6MTY4MTk3ODA4NX0.G-gW5rdzNmpGUp3FW29WPRV-42gN8z2G9OvCvni2DmQ', 'User-Agent': 'axios/1.3.6', 'Content-Length': '36', 'Accept-Encoding': 'gzip, compress, deflate, br' }, url: 'http://localhost:9000/api/v1/dashboard/', data: '{"dashboard_title":"New Dashboard1"}', method: 'post' }, request: <ref *1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: '36', _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 29, [Symbol(kHandle)]: [TCP], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: false, [Symbol(kSetKeepAlive)]: true, [Symbol(kSetKeepAliveInitialDelay)]: 60, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0, [Symbol(RequestTimeout)]: undefined }, _header: 'POST /api/v1/dashboard/ HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Content-Type: application/json\r\n' + 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjgxOTc3MTg1LCJqdGkiOiI2N2QyOWY4ZC04YTI2LTQ1ZWMtYjUzZS1jZjI4Y2JiOGJkYTkiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoxLCJuYmYiOjE2ODE5NzcxODUsImV4cCI6MTY4MTk3ODA4NX0.G-gW5rdzNmpGUp3FW29WPRV-42gN8z2G9OvCvni2DmQ\r\n' + 'User-Agent: axios/1.3.6\r\n' + 'Content-Length: 36\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: localhost:9000\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 1, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/api/v1/dashboard/', _ended: true, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 201, statusMessage: 'CREATED', client: [Socket], _consuming: true, _dumped: false, req: [Circular *1], responseUrl: 'http://localhost:9000/api/v1/dashboard/', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 14, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0, [Symbol(RequestTimeout)]: undefined }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: Writable { _writableState: [WritableState], _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 36, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://localhost:9000/api/v1/dashboard/', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], 'content-type': [Array], authorization: [Array], 'user-agent': [Array], 'content-length': [Array], 'accept-encoding': [Array], host: [Array] }, [Symbol(kUniqueHeaders)]: null }, data: { id: 36, result: { dashboard_title: 'New Dashboard1' } } }

[Done] exited with code=0 in 0.306 seconds

Did you removed the cookies.

@hughhhh hughhhh removed their assignment May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

6 participants