-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Context
We have currenty two SnipeIT intances, test and production. The code I am using in our automated process for creating assets using the PowerShell module can create assets in test instance perfectly but an error is reported from production.
Both instances are not running the same version where production is version 6 and test 5.
Other commands as for example reading assets works perfectly in both instances.
Your Environment
- SnipitPS Module version used: latest 1.10.227
- Operating System and PowerShell version: Windows Server 2019 and PowerShell version 5.1.17763.3770
- Snipe It version: 6
Issue reported
During creation process using the PowerShell module, an error is reported
VERBOSE: Testing connection to https://mysnipe.com.
VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable
VERBOSE: [Invoke-SnipeitMethod] Invoking method Get to URI
VERBOSE: GET https://mysnipe.com/api/v1/statuslabels?limit=1 with 0-byte payload
VERBOSE: received 369-byte response of content type application/json
VERBOSE: [Invoke-SnipeitMethod] Status code:
VERBOSE: @{total=13; rows=System.Object[]}
VERBOSE: Status:
VERBOSE: Messages:
VERBOSE: [Invoke-SnipeitMethod] Function ended
VERBOSE: Connection to https://mysnipe.com tested succesfully.
IsMutuallyAuthenticated : False
Cookies : {snipeit_session=JCFfLsVX6LTbK6JbNog9bS6VTDWq5VE9kPqMvsxE}
Headers : {Vary, X-RateLimit-Limit, X-RateLimit-Remaining, Pragma...}
SupportsHeaders : True
ContentLength : 33
ContentEncoding :
ContentType : application/json
CharacterSet :
Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34
LastModified : 11.07.2023 06:41:28
StatusCode : InternalServerError
StatusDescription : Internal Server Error
ProtocolVersion : 1.1
ResponseUri : https://mysnipe.com/api/v1/hardware
Method : POST
IsFromCache : False
Other test I did was simply: I executed the command New-SnipeitAsset and the from console I give the IDs. After typing the second parameter ID (model_ID) the error is generated when more positional parameters should be asked before
PS H:> New-SnipeitAsset
cmdlet New-SnipeitAsset at command pipeline position 1
Supply values for the following parameters:
status_id: 5
model_id: 950
IsMutuallyAuthenticated : False
Cookies : {snipeit_session=7FXhXtSiwYldBL5mTyBjM578UXcRX8TjUcDvQ85u}
Headers : {Vary, X-RateLimit-Limit, X-RateLimit-Remaining, Pragma...}
SupportsHeaders : True
ContentLength : 33
ContentEncoding :
ContentType : application/json
CharacterSet :
Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34
LastModified : 11.07.2023 06:49:52
StatusCode : InternalServerError
StatusDescription : Internal Server Error
ProtocolVersion : 1.1
ResponseUri : https://assets-it.ebgroup.elektrobit.com/api/v1/hardware
Method : POST
IsFromCache : False
Possible Solution
Do you have any idea or you are familiar with the issue? any help I really appreciate many many thanks.