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

Cannot create new assets #2633

Closed
jmochnick opened this issue Sep 19, 2016 · 5 comments
Closed

Cannot create new assets #2633

jmochnick opened this issue Sep 19, 2016 · 5 comments
Labels
❓ not sure if bug This issue has not been confirmed as a bug yet

Comments

@jmochnick
Copy link

Expected Behavior (or desired behavior if a feature request)

When we create a new asset we expect it to save and return to the All Assets page


Actual Behavior

We create a new asset, and the page simply refreshes without saving the asset. We receive no error messages and all required fields are filled out. Also all custom fields have been removed.


Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running - v3.4.0-9-g67315d8
  • What OS and web server you're running Snipe-IT on - RHEL 6.7
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) - install.sh
  • If you're getting an error in your browser, include that error - no browser errors
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error - New asset page, trying to create a new asset
  • If a stacktrace is provided in the error, include that too. - N/A
  • Any errors that appear in your browser's error console. - none
  • Confirm whether the error is reproduceable on the demo. - no
  • Include any additional information you can find in app/storage/logs and your webserver's logs. - none
  • Include what you've done so far in the installation, and if you got any error messages along the way. - no error message
  • Indicate whether or not you've manually edited any data directly in the database - none
@david-rundle-bah
Copy link

I'm having the same issue - have you attempted to create the same asset twice with the same name?

I get a non-unique error, and I'm checking my database now to see if the record exists, and is just not being displayed.

Also, did you upgrade to version 3.x recently?

@jmochnick
Copy link
Author

We've tried creating the same asset repeatedly, and it never properly saves or brings me to the All Assets page.

We receive no error messages at all. When we click Save at the bottom, the page appears to just refresh with no alerts or assets created.

We've been on 3.x since about August, and the current version we've been on for about a week. The issue has been going on since before the most recent version, but this is the first we've experienced this error since upgrading to 3.x in August.

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

What happens when you tail the laravel log as you're experiencing the error?

Also, can you please show me the DB structure of your assets table?

@snipe snipe added the ❓ not sure if bug This issue has not been confirmed as a bug yet label Sep 20, 2016
@jmochnick
Copy link
Author

Hi there, thanks for the reply.

We took a snapshot of this instance, so we can go back at any time, but to troubleshoot this we reverted the front end to an earlier version while leaving the database untouched. That seemed to fix the problem.

The laravel output is below;

#106 [internal function]: MisterPhilip\MaintenanceMode\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#107 /var/www/snipe-it/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)
#108 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#109 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#110 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#111 /var/www/snipe-it/bootstrap/cache/compiled.php(9948): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#112 /var/www/snipe-it/bootstrap/cache/compiled.php(2366): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#113 /var/www/snipe-it/bootstrap/cache/compiled.php(2350): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#114 /var/www/snipe-it/public/index.php(60): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#115 {main}

assets table structure – copy and pasting this into a text editor will format it properly again.

MariaDB [snipeit]> describe assets;
+-------------------------------+---------------------------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------------+---------------------------------------+------+-----+---------------------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(255) | YES | | NULL | |
| asset_tag | varchar(255) | NO | | NULL | |
| model_id | int(11) | NO | | NULL | |
| serial | varchar(255) | NO | | NULL | |
| purchase_date | date | YES | | NULL | |
| purchase_cost | decimal(13,4) | NO | | 0.0000 | |
| order_number | varchar(255) | YES | | NULL | |
| assigned_to | int(11) | YES | | NULL | |
| notes | text | YES | | NULL | |
| image | text | YES | | NULL | |
| user_id | int(11) | NO | | NULL | |
| created_at | timestamp | NO | | 0000-00-00 00:00:00 | |
| updated_at | timestamp | NO | | 0000-00-00 00:00:00 | |
| physical | tinyint(1) | NO | | 1 | |
| deleted_at | timestamp | YES | | NULL | |
| status_id | int(11) | YES | | NULL | |
| archived | tinyint(1) | NO | | 0 | |
| warranty_months | int(3) | YES | | NULL | |
| depreciate | tinyint(1) | NO | | 0 | |
| supplier_id | int(11) | YES | | NULL | |
| requestable | tinyint(4) | NO | | 0 | |
| rtd_location_id | int(11) | YES | | NULL | |
| accepted | enum('pending','accepted','rejected') | YES | | NULL | |
| last_checkout | datetime | YES | | NULL | |
| expected_checkin | date | YES | | NULL | |
| company_id | int(10) unsigned | YES | | NULL | |
| _snipeit_mac_address | text | YES | | NULL | |
| _snipeit_laptop_lock_passcode | text | YES | | NULL | |
| _snipeit_laptop_lock | text | YES | | NULL | |
+-------------------------------+---------------------------------------+------+-----+---------------------+----------------+

Thanks!!!

@snipe
Copy link
Owner

snipe commented Sep 21, 2016

Hi there - this was already fixed on develop. In the meantime, you can run ALTER TABLE assets MODIFY purchase_cost DECIMAL(13,4) null; in mysql to fix it on your system. (See #2537 for more info)

@snipe snipe closed this as completed Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ not sure if bug This issue has not been confirmed as a bug yet
Projects
None yet
Development

No branches or pull requests

3 participants